RE: Bash script

From: Myers, Mike (
Date: 08/30/01

Message-ID: <F34B3C833DDBD311B77800508B0CB0BF041EB0BA@nwdc02ex>
From: "Myers, Mike" <>
To: "'Sousa Ferreira'" <>, "Security Basics" <>
Subject: RE: Bash script
Date: Thu, 30 Aug 2001 13:34:13 -0700

This is the code fragment I use to check ping. Wrapper it with a while
`true` and a sleep 60.

        ping "$i" 2 > /dev/null 2>&1

        if [ $? -ne 0 ]; then
          echo "host \"$i\" not answering ping...aborting"

 - Mike Myers,

-----Original Message-----
From: Sousa Ferreira []
Sent: August 30, 2001 9:05 AM
To: Security Basics
Subject: Bash script

Hash: SHA1

Hi ...

Long time reader, first time asker here!

Just wondering if someone could help with a "simple" script in $bash
i have to make.
I need a script that´s pings a certain ip, reads the reply and ... if
there is any reply, it reschedules itself to ping the ip again in
lets say 60 secs.
Otherwise it starts a daemon, firewall, backup smb daemon, etc. .

My doubt is on how to get the script to read the ping awnser
(afirmative or not).

The main interest in this is that if the primary firewall fails (UPS
probs i´m having and lack of $$ to other one ;) ) the backup one goes

Sorry for the lamme question and thanks in advance for your opinions
on how can i do it.


As informações contidas neste email são confidenciais
e destinam-se apenas à(s) pessoa(s) para quem foi enviado.

PGP KeyID : 0xB7723B21

Version: PGP 7.0.4