Command:
HOST=typehostnamehere
PING=`ping -q -c 1 $HOST`
if [[ $? -eq 0 ]] ; then
TIME=`echo $PING |tail -1 | cut -d/ -f 5`
echo ${TIME}ms away from $HOST
exit 0
else
echo $HOST could not be reached
exit 2
fi
You need to replace typehostnamehere with the address of the machine you want to ping.
RSS
Twitter
Email

