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