|
@@ -11,7 +11,6 @@ curl -f -H 'Host:demo.infoclinica.ru' 127.0.0.1:9000/login || exit 1
|
|
|
|
|
|
# Проверяем наличие файла с переменной time_to_dead
|
|
|
if [ -f /tmp/dead ];then
|
|
|
-# dead_to_time=$(cat /tmp/dead)
|
|
|
if (( ${curtime} > $(cat /tmp/dead) ));then kill 1;fi
|
|
|
else
|
|
|
# Определяем изменился ли адрес админки
|
|
@@ -21,11 +20,11 @@ else
|
|
|
if [[ ${new_admin_ip} != $(cat /tmp/admin_ip) ]];then
|
|
|
ping -c3 ${new_admin_ip} || exit 0
|
|
|
fi
|
|
|
+# Вычисляем адреса task'ов и сортируем их
|
|
|
sorted=($(echo $(dig tasks.${SERVICE_NAME}.${APPNET} +short)|tr " " "\n"|sort -n))
|
|
|
for (( i=0; i < ${#sorted[*]}; i++ ))
|
|
|
do
|
|
|
- [[ $(ip a | grep ${sorted[${i}]}) ]] && echo $((${i}*180+$(date +%s)+60)) > /tmp/dead
|
|
|
-# 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)+40)) > /tmp/dead
|
|
|
done
|
|
|
fi
|
|
|
fi
|