How can an internet connection be tested without pinging some website? I mean, what if there is a connection but the site is down? Is there a check for a connection with the
Checking Google's index page is another way to do it:
#!/bin/bash WGET="/usr/bin/wget" $WGET -q --tries=20 --timeout=10 http://www.google.com -O /tmp/google.idx &> /dev/null if [ ! -s /tmp/google.idx ] then echo "Not Connected..!" else echo "Connected..!" fi