From 1cb3c060726504df19212aa19e9ef8b5559e29b4 Mon Sep 17 00:00:00 2001 From: Philip Date: Sun, 28 Jun 2015 01:29:43 +0200 Subject: [PATCH 1/2] Changed warning for missing config files --- nsupdate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nsupdate.sh b/nsupdate.sh index 2714015..5a21393 100755 --- a/nsupdate.sh +++ b/nsupdate.sh @@ -34,7 +34,7 @@ command -v drill >/dev/null 2>&1 || command -v nslookup >/dev/null 2>&1 || { ech # check config # ################## if [ ! -f nsupdate.d/*.config ]; then - echo "There does not seem to be ready to be used config file available." ; exit 1; + echo "There does not seem to be any config file available." ; exit 1; fi ################## From 7ef671af06ebf640e6b8ccaecf1bfec98163956e Mon Sep 17 00:00:00 2001 From: Philip Date: Tue, 30 Jun 2015 20:12:59 +0200 Subject: [PATCH 2/2] Fixed the check for config files. Can now handle more than one file. --- nsupdate.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nsupdate.sh b/nsupdate.sh index 5a21393..32ff655 100755 --- a/nsupdate.sh +++ b/nsupdate.sh @@ -33,7 +33,8 @@ command -v drill >/dev/null 2>&1 || command -v nslookup >/dev/null 2>&1 || { ech ################## # check config # ################## -if [ ! -f nsupdate.d/*.config ]; then +configfiles=$(shopt -s nullglob dotglob; echo nsupdate.d/*.config) +if (( ! ${#configfiles} ));then echo "There does not seem to be any config file available." ; exit 1; fi ##################