From 0734b8401e4225e37c691bc0b9ba64e53d2d9472 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 24 May 2019 21:34:08 -0600 Subject: [PATCH] check seaf dirs and services as needed --- backup_new.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/backup_new.sh b/backup_new.sh index 8e791a4..fec6e46 100755 --- a/backup_new.sh +++ b/backup_new.sh @@ -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