On 13Feb2013 03:21, Suvayu Ali <fatkasuvayu+linux(a)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]'\''
No default route - no general purpose internet connection.
A default route but no connectivity? Then something else is wrong that
needs fixing anyway.
Cameron Simpson <cs(a)zip.com.au>
We _like_ the starter! Wouldn't have it any other way. If it doesn't grind,
take it back to the dealer and make them fix it!
- Jon N. Steiger, DoD#1038, <stei0302(a)mary.cs.fredonia.edu>