Return to BSD News archive
#! rnews 1531 bsd Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!swrinde!elroy.jpl.nasa.gov!decwrl!news.PBI.net!news.mathworks.com!newsfeed.internetmci.com!inet-nntp-gw-1.us.oracle.com!nntp-hub.barrnet.net!nntp.hybrid.com!usenet From: Kenneth Coley <coley@hybrid.com> Newsgroups: comp.sys.sun.admin,alt.sys.sun,comp.unix.bsd.misc,comp.unix.programmer,comp.unix.bsd.bsdi.misc,comp.unix.admin Subject: Re: ping script Date: Wed, 03 Jul 1996 07:58:29 -0700 Organization: Hybrid Networks, Inc. Lines: 26 Message-ID: <31DA8A95.61BB@hybrid.com> References: <Pine.SOL.3.93.960702171209.4062B-100000@gold.acns.fsu.edu> NNTP-Posting-Host: dax-nt.hybrid.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.02 (WinNT; I) To: "Douglass E. Davis" <davis@gold.acns.fsu.edu> Xref: euryale.cc.adfa.oz.au comp.sys.sun.admin:69913 alt.sys.sun:10360 comp.unix.bsd.misc:1200 comp.unix.programmer:39061 comp.unix.bsd.bsdi.misc:4214 comp.unix.admin:44418 Just look at the exit status: : for i in `cat ipnums` do ping $i > /dev/null 2>&1 ping $i > /dev/null 2>&1 if [ $? = 0 ] then runactive else runnoanswer fi done Use two pings just because of routing issues, the first ping may get an error. The second ping will verify that the node is really missing. -- Kenneth Coley Network Operations Manager Hybrid Networks, Inc. 408-725-3250 Voice 408-725-2439 Fax coley@hybrid.com http://www.hybrid.com