Ping test in a shell script

#!/bin/sh
 
# -q quiet
# -c nb of pings to perform
 
ping -q -c5 google.com > /dev/null
 
if [ $? -eq 0 ]
then
	echo "ok"
fi
 

Feedback

Great! Thank you very much!
Danilo Castro de Souza
January 17, 2012
#1