From 49f7e9e84dbaf96c6bfee5ff4a53ac80f127262e Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 10 Mar 2018 20:59:55 +0800 Subject: Improve MD5 check on the downloaded image --- dfly-update | 10 ++++------ 1 file 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 -- cgit v1.2.2