From 010ab1dcebbd38e17ddf08b7659d0ab3854afd5b Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Tue, 9 Feb 2021 06:49:33 -0700 Subject: [PATCH] perf(RESTORE): exit if nothing to do --- backup/restore.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backup/restore.sh b/backup/restore.sh index 9696819..d7933a9 100644 --- a/backup/restore.sh +++ b/backup/restore.sh @@ -256,9 +256,13 @@ while [ $# -gt 0 ]; do done ### pre-flight checks +# ensure there's something to do +if [ "$restoreMail" -eq 0 ] && [ "$restoreSQL" -eq 0 ] && [ "$restorePostfix" -eq 0 ] && [ "$restoreRedis" -eq 0 ] && [ "$restoreRedis" -eq 0 ]; then + printf "\n%sAll restore operations skipped -- nothing to do!%s\n\n" "$yellow" "$norm" + exit 0 +fi # set path so checks are valid for this script environment export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - # docker installed? if ! command -v docker >/dev/null; then consoleError '3' 'docker does not seem to be installed!'