From owner-freebsd-questions Sun Dec 16 20:24:54 2001 Delivered-To: freebsd-questions@freebsd.org Received: from catalyst.sasknow.net (catalyst.sasknow.net [207.195.92.130]) by hub.freebsd.org (Postfix) with ESMTP id 10B4937B41A; Sun, 16 Dec 2001 20:24:52 -0800 (PST) Received: from localhost (ryan@localhost) by catalyst.sasknow.net (8.11.6/8.11.6) with ESMTP id fBH4Qob12729; Sun, 16 Dec 2001 22:26:51 -0600 (CST) (envelope-from ryan@sasknow.com) X-Authentication-Warning: catalyst.sasknow.net: ryan owned process doing -bs Date: Sun, 16 Dec 2001 22:26:50 -0600 (CST) From: Ryan Thompson X-X-Sender: To: "Crist J . Clark" Cc: BSD Freak , FreeBSD Questions Subject: Re: ping failure script In-Reply-To: <20011216201931.E15624@blossom.cjclark.org> Message-ID: <20011216222248.K12124-100000@catalyst.sasknow.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 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