TIP: Click on subject to list as thread! ANSI
echo: tech
to: Pascal Schmidt
from: David Drummond
date: 2004-01-27 21:28:08
subject: Network link monitor for linux

Al salaam a'alaykum Pascal

26 Jan 04 22:00, Pascal Schmidt wrote to David Drummond:

 DD>> export result=`ping -c 4 -q ispgate | grep avg | wc -l`
 DD>> if [ $result != 1 ]
 DD>>       ...
 PS> Equivalent (or maybe even better, -c 4 does not exit for me when no 
 PS> replies come, it waits forever for 4 replies to emerge):

 PS> if ! ping -c 4 -w 4 ispgate &> /dev/null; then
 PS>   ...
 PS> fi

 PS> ping exits with 0 exit status when replies come in, or with 1 when no 
 PS> replies come.

There may well be improvements to the script, it was written many years ago
for a much earlier version of Linux. It has continued to work for me to
this day and I've never seen need to update it (other than the ISP).

Regards,
David

--- Msged/LNX TE 06 (pre)
* Origin: Here. (3:640/305)
SEEN-BY: 633/267 270
@PATH: 640/305 954 774/605 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.