I'm thinking that this needs to be changed to a while loop because, at the moment, it'll wait untill all 10000 pings are done. I need this to return when the ping is successful. What are your suggestions?
#!/bin/bash
echo begin ping
if ping -c 100000 8.8.8.8 | grep timeout;
then echo `say timeout`;
else echo `say the internet is back up`;
fi