diff --git a/scripts/winsparkle-xml-updater.sh b/scripts/winsparkle-xml-updater.sh index 7c2740547d07131e6e0351e39d5803a84d68e1cf..55f1aec3da180608cba9a33507e65cdb034467c7 100755 --- a/scripts/winsparkle-xml-updater.sh +++ b/scripts/winsparkle-xml-updater.sh @@ -16,12 +16,25 @@ if [ ! -f ${PACKAGE} ]; then fi if [ ! -s ${SPARKLE_FILE} ]; then + wget --no-check-certificate --retry-connrefused --tries=20 --wait=2 \ --random-wait --waitretry=10 ${SPARKLE_SOURCE} -O ${SPARKLE_FILE} - if [ $? -ne 0 ]; then - echo 'the winsparkle file have been badly overwriten; deleting it.' - rm -f winsparkle.xml - exit 1 + + if [ $? -eq 127 ]; then + rm -f ${SPARKLE_FILE} + COUNTER=0 + curl --retry 2 --retry-delay 2 ${SPARKLE_SOURCE} -o ${SPARKLE_FILE} + until [ $? -eq 0 -o $COUNTER -gt 10 ]; do + sleep 1 + let COUNTER=COUNTER+1 + curl --retry 2 --retry-delay 2 ${SPARKLE_SOURCE} -o ${SPARKLE_FILE} + done + + if [ $? -ne 0 ]; then + echo 'the winsparkle file have been badly overwriten; deleting it.' + rm -f winsparkle.xml + exit 1 + fi fi fi