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-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-devel