On Mon, 2005-10-17 at 21:36 +0530, dipankar das wrote:

> I tried it too: i am getting no decisive variable to single out from here, on 
> which i can make Bash run a loop, say 'for' till that variable gives 
> something like a '0' exit status. 
> 
> Sayamindu suggested a brute-force method: squeezing out some variable from 
> 'ping' on some good server, say, 'www.google.com', but if that server is 
> down, or over-loaded? 
> 
> I want something very decisive. 
> 
> Thank you.

Ping is probably the best tool for this, and you should use the return
value.  But you should ping your gateway or something closer.  For
instance:

==============
#/bin/bash
success=0
ping -w 1 192.168.0.1 > /dev/null
if [ $? != $[success] ]; then echo "ouch"
fi
=============

dan


--
To unsubscribe, send mail to [EMAIL PROTECTED] with the body
"unsubscribe ilug-cal" and an empty subject line.
FAQ: http://www.ilug-cal.org/node.php?id=3

Reply via email to