Przeglądaj źródła

'check_twodns.sh' ändern

Daniel Wenzel 3 lat temu
rodzic
commit
1907c6c26b
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      check_twodns.sh

+ 3 - 3
check_twodns.sh

@@ -18,13 +18,13 @@ if [ $# -ne 3 ]; then
 fi
 
 SerialMaster=$(/usr/bin/dig @${1} ${3} +short SOA | awk '{print $3}')
-if [ $? -ne 0 ]; then
+if [ $? -ne 0 ] || [ -z "$SerialMaster" ]; then
   echo "Error reading Serial from Master for Domain \"${3}\""
   exit 3
 fi
 
 SerialSlave=$(/usr/bin/dig @${2} ${3} +short SOA | awk '{print $3}')
-if [ $? -ne 0 ]; then
+if [ $? -ne 0 ] || [ -z "$SerialSlave" ]; then
   echo "Error reading Serial from Slave for Domain \"${3}\""
   exit 3
 fi
@@ -38,4 +38,4 @@ else
 fi
 
 echo $Status
-exit $STATE
+exit $STATE