From owner-freebsd-questions Sun Dec 16 19:12:31 2001 Delivered-To: freebsd-questions@freebsd.org Received: from serv1.wallnet.com (server1.wallnet.com [208.225.162.122]) by hub.freebsd.org (Postfix) with ESMTP id EF39837B417 for ; Sun, 16 Dec 2001 19:12:28 -0800 (PST) Received: from localhost (timothyk@localhost) by serv1.wallnet.com (8.11.5/8.11.5) with ESMTP id fBH3CNc70315; Sun, 16 Dec 2001 22:12:23 -0500 (EST) (envelope-from timothyk@serv1.wallnet.com) Date: Sun, 16 Dec 2001 22:12:23 -0500 (EST) From: Tim Kellers To: BSD Freak Cc: FreeBSD Questions Subject: Re: ping failure script In-Reply-To: <113fc9110004.110004113fc9@mbox.com.au> Message-ID: <20011216221023.W69928-100000@serv1.wallnet.com> 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 If you've a bent to program, check out "expect" in /usr/lang/ports It's not difficult to learn or use, and it's very well suited to that kind of thing. Tim Kellers CPE/NJIT On Mon, 17 Dec 2001, BSD Freak wrote: > Hi all, > > I want to run a shell script from cron that has the following logic > but I am totally unsure where to start with the syntax. It goes like > this: > > IF 3 consecutive pings to my.host.com fail THEN > echo "Link is DOWN!!" | mail me@mycompany.com > end > > > Thanks in advance.... > > --------------------------------------------------------------------- > Your own fax service 24x7, no extra line or fax machine required > http://www.mbox.com.au > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message