you are right , ping test takes long time..i modified and defined some defaults(for exa ping test about send 4 echo packet check in script)..
now you can give a ping try count for first parameter...
That's a useless use of cat (http://partmaps.org/era/unix/award.html) and useless use of backticks (http://partmaps.org/era/unix/award.html#backticks). Whenever you have for x in `cat file` you can...