From 3b72240d8c9d3b62f3f9883bc5cd3bd7405d58d5 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Wed, 3 Oct 2018 15:57:30 -0600 Subject: [PATCH] Added sqlDetails parameter check --- backup.sh | 10 ++++++++++ sql.empty | 0 2 files changed, 10 insertions(+) create mode 100644 sql.empty diff --git a/backup.sh b/backup.sh index 87994a1..3aa0822 100755 --- a/backup.sh +++ b/backup.sh @@ -256,6 +256,16 @@ elif [ -n "$webUser" ]; then fi fi +## Ensure sqlDetails file exists +if [ ! -f "$sqlDetails" ]; then + 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 + ### Log start of script operations echo -e "\e[1;35m${stamp}-- Start $scriptName execution ---${normal}" \ diff --git a/sql.empty b/sql.empty new file mode 100644 index 0000000..e69de29