From 1330cc8e70853e20e7bb4c8cd8bfcab78d83dde9 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sun, 19 May 2019 00:33:17 -0600 Subject: [PATCH] pre-req: seafile program dir --- backup.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/backup.sh b/backup.sh index ed0d63f..c740d20 100755 --- a/backup.sh +++ b/backup.sh @@ -383,7 +383,7 @@ while getopts ':5:b:d:l:p:s:u:v:w:' PARAMS; do done -### Verify script pre-requisties +### Verify script pre-requisites ## If not running as root, display error on console and exit if [ $(id -u) -ne 0 ]; then @@ -391,20 +391,20 @@ if [ $(id -u) -ne 0 ]; then exit 3 fi -## Check Seafile webroot -# Ensure Seafile webroot is provided -if [ -z "$ncRoot" ]; then - echo -e "\n${err}The Seafile webroot must be specified (-n parameter)" \ - "${normal}\n" +## Check Seafile program directory +# Ensure Seafile program directory is provided +if [ -z "$seafDir" ]; then + echo -e "\n${err}The Seafile program directory must be specified" \ + "(-p parameter)${normal}\n" exit 1 -# Ensure Seafile webroot directory exists -elif [ -n "$ncRoot" ]; then - checkExist fd "$ncRoot" +# Ensure Seafile program directory exists +else + checkExist fd "$seafDir" checkResult="$?" - if [ "$checkResult" = "1" ]; then - # Specified Seafile webroot directory could not be found - echo -e "\n${err}The provided Seafile webroot directory" \ - "(-n parameter) does not exist.${normal}\n" + if [ "$checkResult" -eq 1 ]; then + # Specified Seafile program directory could not be found + echo -e "\n${err}The provided Seafile program directory" \ + "(-p parameter) does not exist.${normal}\n" exit 1 fi fi