Wow, thats Kewl! Thanks Robert, yes, that makes the code a little more portable!
In a similar vein, to make it truly run, and for being so good(!), how do I automate getting the WAN interface name (em0 dc0 etc) on different machines!? Kind regards David Hingston ----- Original Message ----- From: "Robert Huff" <[EMAIL PROTECTED]> To: "Hinkie" <[EMAIL PROTECTED]> Sent: Saturday, September 01, 2007 2:45 PM Subject: Re: FreeBSD Cron Job to run (ifconfig em0 down; ifconfig em0 up) Hello: > from edit.php create / write into new file /usr/bin/pinger.sh #!/bin/sh ping -c1 Insert_1st_Gateway_Hop_Here_commonly_Static_IP_a.b.c.1 if [ $? -eq 2 ]; then ifconfig em0 down ifconfig em0 up echo 'Gateway Down' else echo 'Gateway Up' fi And you might consider replacing: ping -c1 Insert_1st_Gateway_Hop_Here_commonly_Static_IP_a.b.c.1 with: ping -c1 `netstat -rn | head -n 5 | tail -n 1 | awk '{ print $2 }'` Robert Huff _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"