RE: Bash scriptFrom: Myers, Mike (Mike.Myers@NWDC.IBS-LMCO.com)
- Previous message: Cavell.McDermott@apw.com: "Re: Virus to Virus Idea"
- Maybe in reply to: Sousa Ferreira: "Bash script"
- Next in thread: Ryan Hilton: "Re: Bash script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Message-ID: <F34B3C833DDBD311B77800508B0CB0BF041EB0BA@nwdc02ex> From: "Myers, Mike" <Mike.Myers@NWDC.IBS-LMCO.com> To: "'Sousa Ferreira'" <firstname.lastname@example.org>, "Security Basics" <email@example.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"
- Mike Myers, firstname.lastname@example.org
From: Sousa Ferreira [mailto:email@example.com]
Sent: August 30, 2001 9:05 AM
To: Security Basics
Subject: Bash script
-----BEGIN PGP SIGNED MESSAGE-----
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
-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.4
-----END PGP SIGNATURE-----