July 2018
Beginner
264 pages
8h 9m
English
if ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then echo "IPv4 is up"else echo "IPv4 is down"fi
if ping -q -c 1 -W 1 google.com >/dev/nullthen echo "The network is up"else echo "The network is down"fi
case "$(curl -s --max-time 2 -I http://google.com | sed 's/^[^ ]* *\([0-9]\).*/\1/; 1q')" in [23]) echo "HTTP connectivity is up";; 5) echo "The web proxy won't let us through";; *) echo "The network is down or very slow";;esac
Read now
Unlock full access