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

Re: whats wrong with my internet connection checker script?



S Mathias <smathias1972@yahoo.com> 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 offline that it's got no way of
resolving those names to IP addresses.

I'd recommend you turn your pattern match around to look for any sort
of success, rather than one specific instance of failure.

Chris


Reply to: