tomishinets.v %!s(int64=5) %!d(string=hai) anos
pai
achega
e22419dcee
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      healthcheck.sh

+ 2 - 2
healthcheck.sh

@@ -22,9 +22,9 @@ else
       ping -c3 ${new_admin_ip} || exit 0
     fi
     sorted=($(echo $(dig tasks.${SERVICE_NAME}.${APPNET} +short)|tr " " "\n"|sort -n))
-    for i in ${!sorted[*]}
+    for (( i=0; i < ${#sorted[*]}; i++ ))
     do
-      if [[ ${sorted[${i}]} == $(dig ${HOSTNAME}.${APPNET} +short) ]];then time_to_dead=$((${i}*180+${curtime}+20));echo "${time_to_dead}" > /tmp/dead;fi
+      if [[ ${sorted[${i}]} == $(dig ${HOSTNAME}.${APPNET} +short) ]];then echo $((${i}*180+$(date +%s)+20)) > /tmp/dead;fi
     done
   fi
 fi