Hi Josh,

On Tue, 11 Dec 2001 12:06:16 -0500
Josh Baird <[EMAIL PROTECTED]> wrote:

> 
> I can ping it fine, that is not the problem.  The problem is with the grep 
>statement.  It is not returning anything.
>

Sorry I'm not thinking - I guess not everyone has static ip's to make
things easy. With ifconfig throwing out stuff in the format you pasted you
could use something like:

ifconfig | grep "\-\->" | awk '{print $4}'

to get the ip. So overall...

ifconfig | grep tun0 >/dev/null 2>&1 && ping -c2 `ifconfig | grep "\-\->" | awk 
'{print $4}'` 2>&1 > /dev/null

for the first line of the script.

This assumes that the tun0 entry disappears when the interface is down in
the same way that Linux's ifconfig does. This probably isn't important in
your case but for the machine I wrote the script for if the ppp0 interface
goes down then I'll still be able to ping the PPP point to point partner
as routing will have switched to our backup broadband wireless
connection!!

Hope that makes some sense!


Chris

-- 
Chris Wilson <[EMAIL PROTECTED]>
http://www.wapmx.com



Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]?subject=unsubscribe

        

Reply via email to