diff --git a/backup_new.sh b/backup_new.sh index 9b2148e..dac9f25 100755 --- a/backup_new.sh +++ b/backup_new.sh @@ -247,6 +247,18 @@ while [ $# -gt 0 ]; do done +### check pre-requisites and default values +# does the details file exist? +if [ ! -f "$configDetails" ]; then + badParam dne "(-c default)" "$configDetails" +fi +# is borg installed? +command -v borg > /dev/null || \ + printf "\n${err}ERROR: BORG is not installed on this system!${norm}\n\n" +exit 3 + + + ### start logging printf "${mag}[%s] --- Start %s execution ---${norm}\n" \ "$(stamp)" "$scriptName" >> "$logFile" @@ -268,6 +280,7 @@ exit 0 ### error codes # 1: parameter error # 2: not run as root +# 3: borg not installed # 100: could not start seafile service # 101: could not start seahub service # 102: could not stop seafile service