$ 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ë


--
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/4d18b1a2.5000...@xs4all.nl

Reply via email to