From 5e01be1664eec494b6c20d912fff4a88e24216b0 Mon Sep 17 00:00:00 2001 From: Martinski <119833648+Martinski4GitHub@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:55:40 -0700 Subject: [PATCH] Update backupmon.sh Code improvements. --- backupmon.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/backupmon.sh b/backupmon.sh index 69f43db..f4f315d 100644 --- a/backupmon.sh +++ b/backupmon.sh @@ -2570,7 +2570,7 @@ _DownloadCEMLibraryScript_() if [ ! -d "$1" ] then printf "\n**ERROR**: Directory Path [$1] *NOT* FOUND.\n" - return 0 + return 1 fi "$doDL_IsVerboseMode" && \ @@ -2591,6 +2591,7 @@ _DownloadCEMLibraryScript_() ##-------------------------------------## _CheckForCustomEmailLibraryScript_() { + local retCode=0 local doDL_LibScriptMsge="" local doDL_LibScriptFlag=false local doDL_IsVerboseMode=true @@ -2607,16 +2608,23 @@ _CheckForCustomEmailLibraryScript_() if [ -z "${CEM_LIB_VERSION:+xSETx}" ] || \ _CheckLibraryUpdates_CEM_ "$CEMAIL_LIB_LOCAL_DIR" "$1" then + retCode=1 doDL_LibScriptFlag=true doDL_LibScriptMsge=update fi else + retCode=1 doDL_LibScriptFlag=true doDL_LibScriptMsge=install fi - "$doDL_LibScriptFlag" && \ - _DownloadCEMLibraryScript_ "$CEMAIL_LIB_LOCAL_DIR" "$doDL_LibScriptMsge" + if "$doDL_LibScriptFlag" + then + _DownloadCEMLibraryScript_ "$CEMAIL_LIB_LOCAL_DIR" "$doDL_LibScriptMsge" + retCode="$?" + fi + + return "$retCode" } #-----------------------------------------------------------#