Hexxeh / rpi-update

An easier way to update the firmware of your Raspberry Pi
MIT License
1.94k stars 232 forks source link

Allow retry firmware download on failure #260

Closed SkyLined closed 3 years ago

SkyLined commented 6 years ago

I have a pi that needs to connect to the internet through a proxy. For unknown reasons the firmware download fails halfway through quite often when I using this proxy. If rpi-update had a switch that would allow it to retry the download until it succeeds, I would not manually have to run the script again and again to do so.

SkyLined commented 6 years ago

I expect you will need to check the exit code from curl in download_rev and loop to implement this. I would submit a patch, but my bash scripting skills are negligible, so I am unlikely to produce anything useful.

akhepcat commented 6 years ago

Most instances of curl could be replaced by wget, which has a cleaner implementation of retry + continue.

There's really only one instance in the script that needs to be curl, and that's the line that grabs just the headers.

lurch commented 5 years ago

You could try adding the --retry NUM option to the curl commands, to see if that helps? (but if you make local edits to rpi-update, don't forget to run it with sudo UPDATE_SELF=0 rpi-update to stop it overwriting your edits!)

lurch commented 5 years ago

Now that #279 has been merged, you could do this with just sudo CURL_OPTIONS="--retry 10" rpi-update :smiley: (although I've not tested this, as I have reliable internet!)

Ruffio commented 3 years ago

@SkyLined can this issue be closed?

SkyLined commented 3 years ago

Yes on my account - I no longer use a proxy, so I no longer need this feature and cannot test to see if the proposed solution works.