Posted by sbutler on Tue 11 Aug 23:29
report abuse | View followups from flabdablet | download | new post
- CURLOPTS="--silent --fail --remote-time"
- CURLRETRY_COUNT=6
- CURLRETRY_SLEEP=10
- retry_curl () {
- while [ 1 ]; do
- CURLOUT=$(curl $CURLOPTS $@)
- CURLEXIT=$?
- case $CURLEXIT in
- 5|6|7|15|16|28)
- if [ $CURLRETRY_COUNT -gt 0 ]; then
- (( CURLRETRY_COUNT-- ))
- sleep $CURLRETRY_SLEEP
- else
- return $CURLEXIT
- fi
- ;;
- 0)
- return $CURLEXIT
- ;;
- *)
- CURLOUT=''
- return $CURLEXIT
- ;;
- esac
- done
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.