Call the Python healthcheck script as the seafile user

This commit is contained in:
flow.gunso
2020-01-30 17:45:59 +01:00
parent 7efb910719
commit 959749d6ed

View File

@@ -19,10 +19,6 @@
# Grab the status of the active repos then return as healthy/unhealthy # Grab the status of the active repos then return as healthy/unhealthy
# depending the healthy statuses. # depending the healthy statuses.
healthy_statuses=("downloading" "waiting for sync", "uploading", "downloading files", "downloading file list") su - $UNAME << EO
while IFS=$'\t' read -r name status; do ~/healthcheck.py -c ~/.seafile/seafile-data/ $SEAF_LIBRARY_UUID
for healthy_status in "${healthy_statuses[@]}"; do EO
if [[ "$status" == "$healthy" ]]; then exit 0; fi
done
exit 1
done < <(seaf-cli status | grep -v "^#")