On 13Feb2013 03:21, Suvayu Ali fatkasuvayu+linux@gmail.com wrote: | I used to use netcat to check if a particular host is up or if I have | internet connection before I run a few scripts. [...] | Any ideas what happened to it? What can I use as replacement?
If I want to know if I have an internet connection I look for a default route in the output of "netstat -an", thus:
netstat -rn | egrep '''^(default|0.0.0.0) +[1-9]''' >/dev/null
No default route - no general purpose internet connection. A default route but no connectivity? Then something else is wrong that needs fixing anyway.
Cheers,