#!/bin/bash ping -c 1 $1 > /dev/null if [ "$?" -eq "0" ]; then echo $1 PING OK else echo $1 PING FAIL fi