tomishinets.v hace 5 años
padre
commit
6cee725c22
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      healthcheck.sh

+ 2 - 1
healthcheck.sh

@@ -24,7 +24,8 @@ else
     sorted=($(echo $(dig tasks.${SERVICE_NAME}.${APPNET} +short)|tr " " "\n"|sort -n))
     for (( i=0; i < ${#sorted[*]}; i++ ))
     do
-      if [[ ${sorted[${i}]} == $(dig ${HOSTNAME}.${APPNET} +short) ]];then echo $((${i}*180+$(date +%s)+20)) > /tmp/dead;fi
+      [[ $(ip a | grep ${sorted[${i}]}) ]] && echo $((${i}*180+$(date +%s)+20)) > /tmp/dead
+#      if [[ ${sorted[${i}]} == $(dig ${HOSTNAME}.${APPNET} +short) ]];then echo $((${i}*180+$(date +%s)+20)) > /tmp/dead;fi
     done
   fi
 fi