Check something, wait, check again, do something!

Posted on 16th Feb 2014 by admin

Hi guys.

I wonder if someone can help me with this.

Basically, what I want to do is (for arguments sake I will use google.com as an example) check to see if google.com is alive. If its alive, I want it to stop and exit. If its not, I want it to wait a defined amount of time (say 30 seconds) and then check again. If its up this time, I want it to exit, however, if tis still down, I want it to do something (ie send an email).

Any help would be much appriciated.
Thanks

Other forums