I believe iwconfig is specific to just wireless networking, what if people used a USB ethernet adapter and what not.I use "iwconfig | grep -q Link", but that's probably not the best way.
#!/bin/bash host google.com>/dev/null if [ $? -eq 0 ]; then echo "Internet connection is UP" else echo "Internet connection is DOWN" fi
Correct me if I'm wrong but since the C4A server is a virtual webserver sharing an IP with several other virtual webservers, wouldn't it be checking the subdomain name the request is addressed to to determine which internal port to connect to? And wouldn't that effectively mean that if the DNS server is down then the server isn't reachable?What if your DNS server is down but skeezix' C4A server is still reachable? Just kidding
Maybe a better way is to do "ifconfig | grep Bcast", or to get some information from route, netstat, or /proc/net/.
Nice to hear!