Integer comparision.  Added max time and retry parameters to curl in order to make the check a bit more robust