|
@@ -1,14 +1,6 @@
|
|
|
#!/bin/sh
|
|
|
-#service=iru-swarm.infoclinica.ru
|
|
|
-#floating_ip=swarm.sdsys.ru
|
|
|
-
|
|
|
-check_service() {
|
|
|
- curl -f ${service}
|
|
|
- if [ $? == 0 ]; then echo "${service} is up and running!!!"; return 0; else echo "${service} is down!!!"; return 1; fi
|
|
|
-}
|
|
|
-
|
|
|
check_ip() {
|
|
|
- curl -f ${vip}
|
|
|
+ ip a | grep ${vip}/${vin}
|
|
|
if [ $? == 0 ]; then echo "${vip} is exist!!!"; return 0; else echo "The ${vip} doesn't exist!"; return 1; fi
|
|
|
}
|
|
|
|
|
@@ -16,12 +8,7 @@ check=0
|
|
|
|
|
|
while [ ${check} -eq 0 ]
|
|
|
do
|
|
|
-check_service
|
|
|
-if [ $? != 0 ]
|
|
|
-then
|
|
|
- sleep 10
|
|
|
-else
|
|
|
check_ip
|
|
|
if [ $? != 0 ]; then check=1; else sleep 10; fi
|
|
|
-fi
|
|
|
done
|
|
|
+
|