Re: whats wrong with my internet connection checker script?

2010-12-27 Thread shawn wilson
On Dec 27, 2010 7:54 AM, "Joe" wrote: > > On Sun, 26 Dec 2010 23:57:42 + > Chris Davies wrote: > > > S Mathias wrote: > > > 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" > > > > > both sides "false",

Re: Re: whats wrong with my internet connection checker script?

2010-12-27 Thread Bob Proulx
Jasper Noë wrote: > >$ ping -c 4 -w 4 google.com &> /dev/null && ping -c 4 -w 4 www.yahoo.com &> > >/dev/null || echo "no internet connection" > > But, but, ... if the ping to google succeeds, and the ping to yahoo > fails, it prints "no internet". > > $ ping -c 4 -w 4 google.com &> /dev/null ||

Re: whats wrong with my internet connection checker script?

2010-12-27 Thread Camaleón
On Sun, 26 Dec 2010 14:30:36 -0800, S Mathias wrote: (...) > 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" $ > > > > ...both sides "false", because they have no output, because google.com > and www.yahoo

Re: Re: whats wrong with my internet connection checker script?

2010-12-27 Thread Jasper Noë
$ ping -c 4 -w 4 google.com &> /dev/null && ping -c 4 -w 4 www.yahoo.com &> /dev/null || echo "no internet connection" But, but, ... if the ping to google succeeds, and the ping to yahoo fails, it prints "no internet". $ ping -c 4 -w 4 google.com &> /dev/null || ping -c 4 -w 4 www.yahoo.com

Re: whats wrong with my internet connection checker script?

2010-12-27 Thread Joe
On Sun, 26 Dec 2010 23:57:42 + Chris Davies wrote: > S Mathias wrote: > > 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" > > > both sides "false", because they have no output, because google.com > > an

Re: whats wrong with my internet connection checker script?

2010-12-26 Thread Bob Proulx
S Mathias wrote: > perfect! thank you Oliver Grawert! :) made my day :) it's working! : > > ping -W 1 -c 4 google.com >& /dev/null && ping -W 1 -c 4 www.yahoo.com >& > /dev/null || echo "no internet connection" The ping documentation says: -c count Stop after sending count

Re: whats wrong with my internet connection checker script?

2010-12-26 Thread Bob Proulx
S Mathias wrote: > $ true && true || echo hi Both true commands invoked. This satisfied the left hand side of the or and so echo was not invoked. > $ true && false || echo hi > hi Both true and false invoked, and then the echo. > $ false && true || echo hi > hi Only the first false invoked, a

Re: whats wrong with my internet connection checker script?

2010-12-26 Thread Chris Davies
S Mathias wrote: > 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" > both sides "false", because they have no output, because google.com > and www.yahoo.com is reachable. Or because your local system is so off

Re: whats wrong with my internet connection checker script?

2010-12-26 Thread ceduard0
2010/12/26 S Mathias : > $ true && true || echo hi > $ true && false || echo hi > hi > $ false && true || echo hi > hi > $ false && false || echo hi > hi Hi I was trying with this logic of the internet connection checker script. If $ true && true || echo hi <<< All right if $ true && false ||

whats wrong with my internet connection checker script?

2010-12-26 Thread S Mathias
perfect! thank you Oliver Grawert! :) made my day :) it's working! : ping -W 1 -c 4 google.com >& /dev/null && ping -W 1 -c 4 www.yahoo.com >& /dev/null || echo "no internet connection" -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe"

Re: whats wrong with my internet connection checker script?

2010-12-26 Thread Volkan YAZICI
On Sun, 26 Dec 2010, S Mathias 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 o

whats wrong with my internet connection checker script?

2010-12-26 Thread S Mathias
$ 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