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

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



$ 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 &> /dev/null || echo "no internet connection"

Better ?

--Jasper Noë


Reply to: