Well, I've been able to edit Bijan's script to do exactly what I want except. It just runs once. Without putting it in a cron job that would run every 10 secs, how do I get it to just keep repeating itself, preferably with a 10 sec delay?

Curtis Vaughan

On 16 Jan, 2004, at 22:38, Bijan Soleymani wrote:


Curtis Vaughan said:
Has anyone written a script that they're willing to share that pings a
host and when the ping fails it send out an email message?

Could you share it with me?

Here's a quick one:
#!/bin/bash
if ping -c 1 $1;
then echo "success";
else echo "ping failed for $1" | mail -s "ping failure for $1" [EMAIL PROTECTED];
fi


Simply replace "[EMAIL PROTECTED]" with your email address.

Bijan
--
Bijan Soleymani <[EMAIL PROTECTED]>
http://www.crasseux.com


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Reply via email to