From 60784a9ebaa6168b03851f359a83478c70c7dbeb Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 7 Jun 2024 21:24:39 +0200 Subject: tools: Add checksum check to download.sh --- tools/download.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/download.sh b/tools/download.sh index 901fd3f..d407a77 100755 --- a/tools/download.sh +++ b/tools/download.sh @@ -11,7 +11,7 @@ src="$(dirname "${tools}")" doc="${src}/doc" documents=' -ft232r.pdf https://www.ftdichip.com/old2020/Support/Documents/DataSheets/ICs/DS_FT232R.pdf +ft232r.pdf https://www.ftdichip.com/old2020/Support/Documents/DataSheets/ICs/DS_FT232R.pdf 9dc583a87fdd8cc20f538197bb4cf807 ' @@ -26,10 +26,18 @@ do name="$(echo "$line" | cut -d$'\t' -f1)" url="$(echo "$line" | cut -d$'\t' -f2)" + checksum="$(echo "$line" | cut -d$'\t' -f3)" path="${doc}/${name}" if [ ! -f "$path" ] then curl "$url" > "$path" fi + + if [ "${checksum} ${path}" == "$(md5sum "$path")" ] + then + echo "OK ${name}" + else + echo "NOT OK ${name}" + fi done -- cgit v1.2.3-70-g09d2