|
@@ -1,23 +1,26 @@
|
|
|
|
|
|
|
|
|
-
|
|
|
-admin_ip="10.0.29.39"
|
|
|
-ping -c3 ${admin_ip} || new_ip=$(nslookup admin|grep Address|tail -n1|cut -d " " -f2)
|
|
|
-ping -c3 ${new_ip} || echo "admin not available!!! Exit"
|
|
|
-echo ${new_ip}
|
|
|
+
|
|
|
+admin_ip="10.0.29.40"
|
|
|
+ping -c3 ${admin_ip}
|
|
|
+if [[ $? -ne 0 ]]; then
|
|
|
+ new_ip=$(nslookup admin|grep Address|tail -n1|cut -d " " -f2)
|
|
|
+ ping -c3 ${new_ip} || echo "adminhost not available!!! Exit"
|
|
|
+
|
|
|
+ admin_net=$(nslookup admin|grep Address|tail -n1|cut -d " " -f2|cut -d "." -f1-3)
|
|
|
+ for i in $(hostname -I)
|
|
|
+ do
|
|
|
+ if [[ $(echo ${i}|cut -d "." -f1-3) == ${admin_net} ]]; then node_ip=${i};fi
|
|
|
+ done
|
|
|
+ last_node_oct=$(echo ${node_ip}|cut -d "." -f4)
|
|
|
+
|
|
|
+ last_task_node_oct=($(echo $(nslookup tasks.node | grep Address | tail -n2 | cut -d " " -f2| cut -d "." -f4)))
|
|
|
+ IFS=$'\n' sorted=($(sort <<<"${last_task_node_oct[*]}"))
|
|
|
+ unset IFS
|
|
|
+ for i in ${!sorted[*]}
|
|
|
+ do
|
|
|
+ if [[ ${last_node_oct} -eq ${sorted[i]} ]];then : $((t=${i}*3));sleep ${t}m;kill 1;break;fi
|
|
|
+ done
|
|
|
+fi
|
|
|
|
|
|
-
|
|
|
-admin_net=$(nslookup admin|grep Address|tail -n1|cut -d " " -f2|cut -d "." -f1-3)
|
|
|
-for i in $(hostname -I)
|
|
|
-do
|
|
|
- if [[ $(echo ${i}|cut -d "." -f1-3) == ${admin_net} ]]; then node_ip=${i}; echo ${node_ip};fi
|
|
|
-done
|
|
|
-
|
|
|
-
|
|
|
-ip=($(echo $(nslookup tasks.node | grep Address | tail -n2 | cut -d " " -f2| cut -d "." -f4)))
|
|
|
-IFS=$'\n' sorted=($(sort <<<"${ip[*]}"))
|
|
|
-unset IFS
|
|
|
-for i in ${!sorted[*]}
|
|
|
-do
|
|
|
- if [[ ${var} -eq ${sorted[i]} ]];then : $((t=${i}*3));sleep ${t}m;echo "then go to sleep ${t}";break;fi
|
|
|
-done
|
|
|
+curl -f -H 'Host:demo.infoclinica.ru' 127.0.0.1:9000/login || exit 1
|