It says it all. Should work for ethx and pppx IFACEs
Jacques

#!/bin/sh
# Check every IPDELAY seconds that IP exists for IFACE
# J. Nilo, June 2002

IFACE=eth2
IPDELAY=3

getip() {
  IP=`ip addr show $IFACE 2>/dev/null | grep inet | \
        sed 's/.*inet //;s/ .*//;s/\/.*//'`
}

echo "Starting checkip: " >> /var/log/syslog

while true; do
        getip
        if ! [ "$IP" ];then
                echo "$IFACE is down"
# Execute any command here
                break
        fi
        sleep $IPDELAY
done
exit

_______________________________________________________________

Multimillion Dollar Computer Inventory
Live Webcast Auctions Thru Aug. 2002 - http://www.cowanalexander.com/calendar



------------------------------------------------------------------------
leaf-user mailing list: [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user
SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - 
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink


_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to