FreeBSD Cron Job to run (ifconfig em0 down; ifconfig em0 up)

Mak Kolybabi mak_kolybabi at umanitoba.ca
Wed Aug 29 07:31:20 PDT 2007


> Here's what I'd use:
> ping -c 1 a.b.c.d; TESTV=$?; if [ $TESTV != 0 ]; then `ifconfig em0 down`;

I'd suggest something more like:

ping -c 1 $host
[ $? -eq 0 ] && ifconfig em0 down && ifconfig em0 up

or

ping -c 1 $host
if [ $? -eq 0 ]; then
	ifconfig em0 down && ifconfig em0 up
fi


--
Matthew Anthony Kolybabi (Mak)

() ASCII Ribbon Campaign | Against HTML e-mail
/\  www.asciiribbon.org  | Against proprietary extensions



More information about the freebsd-questions mailing list