![]() |
sponsored links |
|
|
sponsored links
|
|
1
30th July 03:17
External User
Posts: 1
|
Could you share it with me?
Curtis Vaughan -- To UNSUBSCRIBE, email to debian-user-request@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
2
30th July 03:17
External User
Posts: 1
|
Curtis Vaughan said:
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" bijan@psq.com; fi Simply replace "bijan@psq.com" with your email address. Bijan -- Bijan Soleymani <bijan@psq.com> http://www.crasseux.com -- To UNSUBSCRIBE, email to debian-user-request@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
4
30th July 12:01
External User
Posts: 1
|
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 -- To UNSUBSCRIBE, email to debian-user-request@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
5
30th July 12:01
External User
Posts: 1
|
Actually this is the way I tried to get it to continually loop.
Apparently it does, but it only send out messages as to failures after I have killed the process. #!/bin/bash while :; do ping='10.0.0.3' if ping -c 1 $ping; then echo "success"; else echo "ping failed for $ping" | mail -s "ping failure for $ping" curtis; fi done Curtis Vaughan -- To UNSUBSCRIBE, email to debian-user-request@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|