check seaf dirs and services as needed

This commit is contained in:
Asif Bacchus 2019-05-24 21:34:08 -06:00
parent e7e4658cd7
commit 0734b8401e

View File

@ -249,6 +249,24 @@ if [ $use503 -eq 1 ]; then
printf "${cyan}[%s] -- [INFO] Using 503 functionality --${norm}\n" \
"$(stamp)" >> "$logFile"
fi
# seafile directories
if [ ! -d "$seafDir" ]; then
badParam dne "(--seafdir default)" "$seafDir"
elif [ ! -d "$seafData" ]; then
badParam dne "(--seafdata default)" "$seafData"
fi
# offline backup
if [ $offlineBackup -eq 1 ]; then
if ! systemctl list-unit-files | \
grep -Eq "^$seafService |^$seafService.service"
then
badParam svc "(--seafile-service default)" "$seafService"
elif ! systemctl list-unit-files | \
grep -Eq "^$seafHub |^$seafHub.service"
then
badParam svc "(--seahub-service default)" "$seafHub"
fi
fi
### start logging