Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Aug 2007 09:31:11 -0500
From:      Mak Kolybabi <mak_kolybabi@umanitoba.ca>
To:        Eric Crist <mnslinky@gmail.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: FreeBSD Cron Job to run (ifconfig em0 down; ifconfig em0 up)
Message-ID:  <20070829143111.GA10002@brisbane>
In-Reply-To: <FD866B42-B6DA-4AC1-A4B0-EC858835CEBE@gmail.com>
References:  <01a901c7ea3d$0ad62720$1e00a8c0@cheqsoft.local> <FD866B42-B6DA-4AC1-A4B0-EC858835CEBE@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070829143111.GA10002>