Explorar o código

'check_twodns.sh' ändern

Daniel Wenzel %!s(int64=3) %!d(string=hai) anos
pai
achega
1907c6c26b
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  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