This script checks if a remote host is up (or at least answering to ping)
- #!/bin/bash
- ping -c 1 $1 >/dev/null 2>&1
- if [ "$?" = "0" ]; then
- echo -n "up"
- else
- echo -n "down"
- fi
Shorter URL
Want to share or tweet this post? Please use this short URL: http://ozh.in/l
This entry "Online check script" was posted on 02/02/2004 at 10:21 pm and is tagged with Bash, Code, Linux
Watch this discussion : Comments RSS 2.0.