|
@@ -0,0 +1,23 @@
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+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_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
|