On Sun, 26 Dec 2010, S Mathias <smathias1...@yahoo.com> writes:
> $ 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
>
> ...both sides "false", because they have no output, because google.com and 
> www.yahoo.com is reachable.
> how come it writes "no internet connection"? [at the longest line]
> i just want a "oneliner" that checks if theres "internet connection" or no. :\
>
> where did i screw up? 8)

Since both returns false, you should echo "yes", not "no".


Cheers.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87ei94jh0o....@alamut.ozu.edu.tr

Reply via email to