TIP: Click on subject to list as thread! ANSI
echo: tech
to: David Drummond
from: Pascal Schmidt
date: 2004-01-26 22:00:24
subject: Network link monitor for linux

Hi David! :-)

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

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

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

Ciao
Pascal

--- Msged/LNX 6.1.1
* Origin: Priority override. Tears of Ra. (1:153/401.2)
SEEN-BY: 633/267 270
@PATH: 153/401 307 140/1 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™.