Re: whats wrong with my internet connection checker script?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Sun, 26 Dec 2010, S Mathias wrote:

> To: centos@xxxxxxxxxx
> From: S Mathias <smathias1972@xxxxxxxxx>
> Subject:  whats wrong with my internet connection checker script?
> 
> $ true && true || echo hi
> $ true && false || echo hi
> hi
> $ false && true || echo hi
> hi
> $ false && false || echo hi
> hi
> $ ping -W 1 -c 4 google.com >& /dev/null | grep -q "100% packet loss" && ping -W 1 -c 4 www.yahoo.com >& /dev/null | grep -q "100% packet loss" || echo "no internet connection"
> no internet connection
> $
> ping -W 1 -c 4 google.com >& /dev/null | grep "100% packet loss"
> $
> ping -W 1 -c 4 www.yahoo.com >& /dev/null | grep "100% packet loss"
> $

Would a bash script be more simple, rather than trying to do 
all the piping stuff on one line?

Keith

-- 
In theory, theory and practice are the same;
in practice they are not.

This email was sent from my laptop with Centos 5.5
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux