#!/bin/sh
|
|
IP=$1
|
|
[ -x /usr/sbin/fping ] && {
|
|
fping -t 100 -c 1 $IP &> /dev/null && echo 1 || echo 0
|
|
} || {
|
|
ping -w 1 -c 1 $IP &> /dev/null && echo 1 || echo 0
|
|
}
|