Check for HTTP error codes >= 400 when updating rpi-update

See: https://github.com/Hexxeh/rpi-update/issues/228
This commit is contained in:
popcornmix
2017-01-13 17:41:36 +00:00
parent 850f420871
commit ca8378d882

View File

@@ -46,7 +46,7 @@ function update_self() {
echo " *** Performing self-update" echo " *** Performing self-update"
_tempFileName="$0.tmp" _tempFileName="$0.tmp"
if ! curl -Ls --output "${_tempFileName}" "${UPDATE_URI}"; then if ! curl -Lfs --output "${_tempFileName}" "${UPDATE_URI}"; then
echo " !!! Failed to download update for rpi-update!" echo " !!! Failed to download update for rpi-update!"
echo " !!! Make sure you have ca-certificates installed and that the time is set correctly" echo " !!! Make sure you have ca-certificates installed and that the time is set correctly"
exit 1 exit 1
@@ -266,7 +266,7 @@ function do_update {
function download_rev { function download_rev {
if [[ ${SKIP_DOWNLOAD} -eq 0 ]]; then if [[ ${SKIP_DOWNLOAD} -eq 0 ]]; then
if ! curl -L --output /dev/null --silent --head --fail "${REPO_URI}/tarball/${FW_REV}"; then if ! curl -Lfs --output /dev/null --head --fail "${REPO_URI}/tarball/${FW_REV}"; then
echo "Invalid git hash specified" echo "Invalid git hash specified"
exit 1 exit 1
fi fi