#!/bin/sh PING=/bin/ping SH=/bin/sh RM=/bin/rm NOIP=1 if [ -f ./ping.ok ]; then $RM ./ping.ok fi for i in `cat ./ping.conf` do if [ "$i" != "" ]; then NOIP=0 $SH -c "$PING -c1 $i 2>/dev/null 1>/dev/null && echo ok > ./ping.ok" & fi done if [ "$NOIP" == "1" ]; then exit 0 fi COMPT=20 while [ $COMPT -ne 0 ]; do if [ -f ./ping.ok ]; then RES=`cat ./ping.ok` fi if [ "$RES" == "ok" ]; then $RM ./ping.ok exit 0; fi COMPT=$[$COMPT-1] sleep 1 done echo "ping.sh => Alert ! NO responses !" >> /var/log/ha-log exit 1;