aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-10 20:59:55 +0800
committerAaron LI <aly@aaronly.me>2018-03-10 20:59:55 +0800
commit49f7e9e84dbaf96c6bfee5ff4a53ac80f127262e (patch)
treed86c3719e0ed3247e303b2721ef4e9fa873d4204
parent23461578e97fafd21541730db5dfb7f68f4b4236 (diff)
downloaddfly-update-49f7e9e84dbaf96c6bfee5ff4a53ac80f127262e.tar.bz2
Improve MD5 check on the downloaded image
-rwxr-xr-xdfly-update10
1 files changed, 4 insertions, 6 deletions
diff --git a/dfly-update b/dfly-update
index 9bc9731..17fe5f7 100755
--- a/dfly-update
+++ b/dfly-update
@@ -441,12 +441,10 @@ cmd_download() {
local url=$(get_image_url ${filename})
local filepath="${CACHE_DIR}/${filename}"
download_image "${url}" "${filepath}"
- if checksum_image "${filepath}" "${md5}"; then
- echo "Downloaded and MD5-checked image file."
- else
- echo "Downloaded image file does not match the MD5!"
- exit ${EC_MD5}
- fi
+ echo -n "MD5 checking file ... "
+ checksum_image "${filepath}" "${md5}" \
+ && echo "OK" \
+ || error ${EC_MD5} "FAILED!"
}
# Mount the given image file