From af4fcf3cf33bf414285a319ff7f5b5674ca171e9 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Mon, 8 Feb 2021 10:25:24 -0700 Subject: [PATCH] fix(RESTORE): exit on invalid backup location --- backup/restore.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backup/restore.sh b/backup/restore.sh index 03889ed..91e9c96 100644 --- a/backup/restore.sh +++ b/backup/restore.sh @@ -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.'