update: rndc: fail if no read perms on $RNDC_KEY
authorTero Marttila <terom@paivola.fi>
Tue, 20 Mar 2012 13:43:44 +0200
changeset 569 3613e93e4fd7
parent 568 3d6bf3864d8a
child 570 b4b590efe3ef
update: rndc: fail if no read perms on $RNDC_KEY
bin/update
--- a/bin/update	Tue Mar 20 13:40:33 2012 +0200
+++ b/bin/update	Tue Mar 20 13:43:44 2012 +0200
@@ -35,6 +35,7 @@
 NAMED_CHECKZONE=/usr/sbin/named-checkzone
 HG=/usr/bin/hg
 RNDC=/usr/sbin/rndc
+RNDC_KEY=/etc/bind/rndc.key
 
 ### Command-line argument handling
 
@@ -714,11 +715,16 @@
 #
 # Invokes `rndc reload`, showing its output.
 function deploy_zones {
+    local msg="Reload zones"
+
     if [ $DEPLOY_SKIP ]; then
-        log_skip "Reload zones: skipped"
+        log_skip    "$msg: skipped"
+    
+    elif [ ! -r $RNDC_KEY ]; then
+        log_error   "  $msg: rndc: permission denied: $RNDC_KEY"
 
     else
-        log_update "Reload zones..."
+        log_update  "$msg..."
 
         # run
         indent "        rndc: " \
@@ -734,7 +740,7 @@
     local repo=$REPO
     local commit_msg="$COMMIT_MSG"
 
-    local msg="Commit changes in $repo..."
+    local msg="Commit changes in $repo"
 
     # operate?
     if [ $COMMIT_FORCE ]; then