RE: Bash script

From: Myers, Mike (Mike.Myers@NWDC.IBS-LMCO.com)
Date: 08/30/01


Message-ID: <F34B3C833DDBD311B77800508B0CB0BF041EB0BA@nwdc02ex>
From: "Myers, Mike" <Mike.Myers@NWDC.IBS-LMCO.com>
To: "'Sousa Ferreira'" <sousaferreira@netcabo.pt>, "Security Basics" <security-basics@securityfocus.com>
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"
          exit
        fi

Cheers,
 - Mike Myers, mike.myers@nwdc.ibs-lmco.com

-----Original Message-----
From: Sousa Ferreira [mailto:sousaferreira@netcabo.pt]
Sent: August 30, 2001 9:05 AM
To: Security Basics
Subject: Bash script

-----BEGIN PGP SIGNED MESSAGE-----
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
off.

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

-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.4

iQA/AwUBO45kGyNcH2C3cjshEQIHSwCfYbuVOFXRjOVM5/TcB/nhszIEwQUAn0O/
UDH6KJFEj0eFh6GskVHB0xSB
=GCeL
-----END PGP SIGNATURE-----



Relevant Pages

  • Re: [SLE] emailing myself when a ping command fails via crontab????
    ... but I have a perl script to monitor a webserver. ... First the script tries to ping it's DNS servers, ...
    (SuSE)
  • RE: ICMP (Ping)
    ... script to locate vulnerabilities(example point and case: ... Is it good to allow UDP ping packets? ... Guys again, I am not saying that you disable pings and walk away, job ... 300K and you guys are right, it port scans like a freaking demon. ...
    (Security-Basics)
  • RE: Bash script
    ... bash-2.04$ ping www.yahoo.com ... packets transmitted, 1 packets received, 0% packet loss ... > Subject: Bash script ...
    (Security-Basics)
  • Re: Bash script
    ... Subject: Bash script ... > My doubt is on how to get the script to read the ping awnser ... > PGP KeyID: 0xB7723B21 ...
    (Security-Basics)
  • Re: Bash script
    ... Subject: Bash script ... > My doubt is on how to get the script to read the ping awnser ... > PGP KeyID: 0xB7723B21 ...
    (Security-Basics)