check_ip.sh 271 B

1234567891011121314
  1. #!/bin/sh
  2. check_ip() {
  3. ip a | grep ${vip}/${vin}
  4. if [ $? == 0 ]; then echo "${vip} is exist!!!"; return 0; else echo "The ${vip} doesn't exist!"; return 1; fi
  5. }
  6. check=0
  7. while [ ${check} -eq 0 ]
  8. do
  9. check_ip
  10. if [ $? != 0 ]; then check=1; else sleep 10; fi
  11. done