I have a script I run to deploy 2 web services and a front-end application. The script calls a method that checks to see if the 2 back-end services are up and running. If so
If you use --max-time 10 this will kill your connection before 10 seconds so its not useful when downloading.
--max-time 10
Following will retry 300 times with 5sec delay and 30sec connection timeout
curl \ --connect-timeout 30 \ --retry 300 \ --retry-delay 5 \ URL