Instantly share code, notes, and snippets.
ping -t 1 -q google.com | grep "0.0% packet loss" | wc -l
returns 1 for internet, 0 for no internet