#
# Check if we can access internet. 
# Can be used by crm_alarm to not send email
# is network is down.
#

host=yahoo.com
for i in 1 2 3 4 5
do
        ping -q -c 1 $host > /dev/null 2>&1

        if [ "$?" == "0" ]
        then
                exit 0
        fi
        sleep 1
done
exit 1
