Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Dec 2001 22:26:50 -0600 (CST)
From:      Ryan Thompson <ryan@sasknow.com>
To:        "Crist J . Clark" <cjc@FreeBSD.ORG>
Cc:        BSD Freak <bsd-freak@mbox.com.au>, FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   Re: ping failure script
Message-ID:  <20011216222248.K12124-100000@catalyst.sasknow.net>
In-Reply-To: <20011216201931.E15624@blossom.cjclark.org>

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

- Ryan

-- 
  Ryan Thompson <ryan@sasknow.com>
  Network Administrator, Accounts

  SaskNow Technologies - http://www.sasknow.com
  #106-380 3120 8th St E - Saskatoon, SK - S7H 0W2

        Tel: 306-664-3600   Fax: 306-664-1161   Saskatoon
  Toll-Free: 877-727-5669     (877-SASKNOW)     North America


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?20011216222248.K12124-100000>