From eeda084d67da94d5c7d5bca601e335c4bced7084 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Wed, 12 Sep 2018 00:16:26 -0600 Subject: [PATCH] Added check for empty or non-existant account details file --- cfddns.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cfddns.sh b/cfddns.sh index 50af580..e7df06c 100755 --- a/cfddns.sh +++ b/cfddns.sh @@ -50,10 +50,14 @@ if [ -z "$accountFile" ] || [[ $accountFile == -* ]]; then echo -e "\e[1;31mNo file containing account details was specified." echo -e "\e[0;31m(-f parameter empty or missing)\e[0m" exit 101 +elif [ ! -s "$accountFile" ]; then + echo -e "\e[1;31mAccount details file is either empty or does not" \ + "exist.\e[0m" + exit 102 elif [ -z ${dnsRecords} ]; then echo -e "\e[1;31mNo DNS records were specified." echo -e "\e[0;31m(-r parameter(s) empty or missing)\e[0m" - exit 102 + exit 103 fi