public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Adam Carter <adamcarter3@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] irritating cron habit : solved
Date: Mon, 21 Feb 2011 22:32:57 +1100	[thread overview]
Message-ID: <AANLkTimBsmROm+BVeRxEq_ZySA1CULxKrxXwjwjk2bf4@mail.gmail.com> (raw)
In-Reply-To: <20110221102343.GB24111@ksp.sk>

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

>
> btw, if I need to check if the network is up in a script, I usually do
>
> ping -q -c1 -w4 some.remote.host >/dev/null 2>&1 &&
> command-to-run-if-remote-host-reachable
>
> It the advantage that it checks directly connection to the host
> you wish to connect to, so it also won't run the command if your network
> is up, but the remote host is inaccessible...
>
> If your server doesn't respond to pings, just use some other server
> (eg google's public dns 8.8.8.8)
>


Or you could use hping, which has the advantage that it tests the actual
service you want to use, rather than just the host it sits on;

sphinx adam # hping2 -c 1 -S -p 80 www.google.com >/dev/null 2>&1 && echo
"it worked"
it worked

[-- Attachment #2: Type: text/html, Size: 1112 bytes --]

      reply	other threads:[~2011-02-21 11:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-20 14:04 [gentoo-user] irritating cron habit Philip Webb
2011-02-20 15:27 ` Florian Philipp
2011-02-20 18:18   ` Philip Webb
2011-02-21  5:39     ` [gentoo-user] irritating cron habit : solved Philip Webb
2011-02-21 10:23       ` YoYo Siska
2011-02-21 11:32         ` Adam Carter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimBsmROm+BVeRxEq_ZySA1CULxKrxXwjwjk2bf4@mail.gmail.com \
    --to=adamcarter3@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox