In: , ,
On: 2004 / 02 / 02 Viewed: 50046 times
Shorter URL for this post: http://ozh.in/l

This script checks if a remote host is up (or at least answering to ping)

CODE:
  1. #!/bin/bash
  2. ping -c 1 $1>/dev/null 2>&1
  3. if [ "$?" = "0" ]; then
  4. echo -n "up"
  5. else
  6. echo -n "down"
  7. fi

Shorter URL

Want to share or tweet this post? Please use this short URL: http://ozh.in/l

Metastuff

This entry "Online check script" was posted on 02/02/2004 at 10:21 pm and is tagged with , ,
Watch this discussion : Comments RSS 2.0.

No Comment yet

No comments yet. You could get "First Post!" which would bring you fame, luxury cars and chicks.

Leave a Reply

Comment Guidelines or Die

  • HTML: You can use these tags: <a href=""> <em> <i> <b> <strong> <blockquote>
  • Posting code: Post raw code (no <> &lt; etc) within appropriate tags : [php][/php], [css][/css], [html][/html], [js][/js], [sql][/sql], [xml][/xml], or generic [code][code]
  • Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar.
  • Spam: Various spam plugins on patrol. I'll put pins in a Voodoo doll if you spam me.
  • I will mark as Spam test comments, all comments with SEO names (ie "My Cool Online Shop" instead of "Joe") or containing forum-like signatures.

Read more ?

 Alias »