Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Dec 2001 01:03:14 -0800
From:      "Crist J . Clark" <cristjc@earthlink.net>
To:        Ryan Thompson <ryan@sasknow.com>
Cc:        BSD Freak <bsd-freak@mbox.com.au>, FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: ping failure script
Message-ID:  <20011217010314.G15624@blossom.cjclark.org>
In-Reply-To: <20011216222248.K12124-100000@catalyst.sasknow.net>; from ryan@sasknow.com on Sun, Dec 16, 2001 at 10:26:50PM -0600
References:  <20011216201931.E15624@blossom.cjclark.org> <20011216222248.K12124-100000@catalyst.sasknow.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 16, 2001 at 10:26:50PM -0600, Ryan Thompson wrote:
> Crist J . Clark wrote to Ryan Thompson:
> 
> > > ping will only fail if no replies are received.
> > > The above example could use some better input error handling,
> > > but otherwise, it should do what you want.
> >
> > Nope, ping(1) will never die if it doesn't get the responses. You need
> > to add the '-w' option. Something like,
> >
> >   PING="/sbin/ping -q -c 3 -w 10"
> >
> > Should do it.
> 
> Which ping are you using? ping in 4.4 doesn't appear to support -w.
> When I (very briefly) tested this code, it timed out after about 30
> seconds and returned a failure.

Oops.

s/-w/-t/

You're right though, ping(8) times out now-a-days on its own. Looks
like that was added in revision 1.37 (1998/05/25)?
-- 
"It's always funny until someone gets hurt. Then it's hilarious."

Crist J. Clark                     |     cjclark@alum.mit.edu
                                   |     cjclark@jhu.edu
http://people.freebsd.org/~cjc/    |     cjc@freebsd.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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