#!/bin/sh

if [ $# -eq 3 ]
  then cat <<HELP

pingtest <IP> <NAME>

This tool needs one ip as a parameter and a second with a
shortname/comment and will just answer with a coloured "ok" or "fail".

HELP

exit 1
fi
printf "%-15s%15s    " $1 $2; ping -q -f -c 3 -W 1 $1 > /dev/null 2>&1 && echo -e '\t\033[32mok\033[39m' || echo -e '\t\033[31mfail\033[39m'