check: details exist and borg installed
This commit is contained in:
parent
5df96bf69d
commit
658a8c0605
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user