多分、この程度の精度でOKなんだろ。

if ping -c 1 www.yahoo.com >/dev/null 2>&1; then
echo "出来ます"
else
echo "出来ません"
fi