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

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

  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

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar and sign for a free account
Spam: Various spam plugins may be activated. I'll put pins in a Voodoo doll if you spam me.

Read more ?

 Alias »