watch seafile
This commit is contained in:
18
main.sh
Executable file
18
main.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# caso 1, seafile no funciona
|
||||||
|
|
||||||
|
getcode(){
|
||||||
|
url="${1?- No url passed}"
|
||||||
|
curl --fail-early -s -o /dev/null -w "%{http_code}" "$url"
|
||||||
|
}
|
||||||
|
|
||||||
|
site="https://seafile.clonbg.es/accounts/login/?next=/"
|
||||||
|
|
||||||
|
code=$(getcode "$site")
|
||||||
|
|
||||||
|
if [[ "$code" != 2?? ]];then
|
||||||
|
DATE=$(date +"%F_%H:%M:%S")
|
||||||
|
echo "$DATE docker restart seafile-mysql seafile-memcached seafile" >> "/home/ubunturpi/logs/docker_status.txt"
|
||||||
|
docker restart seafile-mysql seafile-memcached seafile
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user