From b19779b2c8b769b3bd2bc9fb4cf858f340a11cf5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 24 Jul 2016 11:49:26 +0100 Subject: [PATCH] Exit with error message is git hash is invalid --- rpi-update | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rpi-update b/rpi-update index 93700e9..d47e00c 100755 --- a/rpi-update +++ b/rpi-update @@ -266,6 +266,10 @@ function do_update { function download_rev { if [[ ${SKIP_DOWNLOAD} -eq 0 ]]; then + if ! curl -L --output /dev/null --silent --head --fail "${REPO_URI}/tarball/${FW_REV}"; then + echo "Invalid git hash specified" + exit 1 + fi echo " *** Downloading specific firmware revision (this will take a few minutes)" rm -rf "${FW_REPOLOCAL}" mkdir -p "${FW_REPOLOCAL}"