From 3db1773e651bf928d58a4f56f91992bfb5deddea Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Wed, 3 Oct 2018 16:04:05 -0600 Subject: [PATCH] Updated sqlDetails check to use checkExist --- backup.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backup.sh b/backup.sh index 3073e4f..eee48d9 100755 --- a/backup.sh +++ b/backup.sh @@ -257,15 +257,17 @@ elif [ -n "$webUser" ]; then fi ## Ensure sqlDetails file exists -if [ ! -f "$sqlDetails" ]; then +checkExist ff "$sqlDetails" +checkResult="$?" +if [ "$checkResult" = "1" ]; then + # sqlDetails file cannot be found echo -e "\n${err}The file containing your SQL details does not exist" \ "(-s parameter)${normal}\n" exit 1 -elif [ ! -s "$sqlDetails" ]; then - echo -e "\n${err}The file containing your SQL details is empty.${normal}\n" - exit 1 fi +echo "using $sqlDetails" +exit 99 ### Log start of script operations echo -e "\e[1;35m${stamp}-- Start $scriptName execution ---${normal}" \