Optional argument for DNS master IP
authorAndreas Bilke <abilke@cosy.sbg.ac.at>
Thu, 22 Dec 2016 07:58:37 +0000 (08:58 +0100)
committerAndreas Bilke <abilke@cosy.sbg.ac.at>
Thu, 22 Dec 2016 07:58:37 +0000 (08:58 +0100)
nagios/check_zone_signature

index 5fd484b..4ebe509 100755 (executable)
@@ -29,14 +29,18 @@ set -e
 set -u
 set -f
 
-if [ $# -ne 1 ]; then
-    echo "usage: $0 <ZONE>" >&2
+if [ $# -ne 1 ] && [ $# -ne 2 ]; then
+    echo "usage: $0 <ZONE> [<MASTER>]" >&2
     exit 3
 fi
 
 ZONE="$1"
 
-MASTER=$(hostname -f)
+if [ $# -eq 1 ]; then
+    MASTER=$(hostname -f)
+else
+    MASTER="$2"
+fi
 EXTRA="-b ::1"
 
 tmp=$(mktemp)