fix(RESTORE): exit on invalid backup location

This commit is contained in:
Asif Bacchus 2021-02-08 10:25:24 -07:00
parent 561437d667
commit af4fcf3cf3
1 changed files with 6 additions and 0 deletions

View File

@ -251,6 +251,12 @@ fi
if [ ! -f "$mcDockerCompose" ]; then
consoleError '1' "docker-compose configuration ($mcDockerCompose) cannot be found."
fi
# backup location?
if [ -z "$backupLocation" ]; then
consoleError '1' "'--backup-location' cannot be unspecified or null/empty."
elif [ ! -d "$backupLocation" ]; then
consoleError '1' "${backupLocation}: directory cannot be found."
fi
# change to mailcow directory so commands execute properly
\cd "${mcConfig%/*}" || consoleError '4' 'Cannot change to mailcow directory as determined from mailcow.conf location.'