Bash-check-if-host-pingable
Jump to navigation
Jump to search
check_remote() { local VALIDATE=`ping -c 3 ${IP} >/dev/null 2>&1; echo $?` if [ ${VALIDATE} -eq 0 ];then echo "Failure: IP address ${IP} is still pingable!"; exit 2 else echo "Confirmed: IP address ${IP} is not pingable." fi }