On 13Feb2013 08:02, Patrick O'Callaghan <pocallaghan(a)gmail.com> wrote:
| On Wed, 2013-02-13 at 20:31 +1100, Cameron Simpson wrote:
| > On 13Feb2013 01:06, Patrick O'Callaghan <pocallaghan(a)gmail.com> wrote:
| > | On Wed, 2013-02-13 at 14:40 +1100, Cameron Simpson wrote:
| > | > 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
| > |
| > | netstat -an ...
| >
| > That prints all the existing connections and sockets.
| > -rn prints the routing table.
|
| I was merely pointing out that your two references to netstat use
| different options.
Oh. Whoops; hadn't noticed my typo. -rn is the option set I meant, and
that I use for "am I connected to the internet?" in my own scripts.
--
Cameron Simpson <cs(a)zip.com.au>
Technique will get you through times of no strength a lot better than
strength will get you through times of no technique. - the Nealomatic