diff options
author | xengineering <me@xengineering.eu> | 2024-06-07 21:24:39 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-06-07 21:24:39 +0200 |
commit | 60784a9ebaa6168b03851f359a83478c70c7dbeb (patch) | |
tree | 5445991a0476d3a7c72b7cc92f2486605e947bbc /tools/download.sh | |
parent | d8f8de953044328932836a450cbb4157736ba2d2 (diff) | |
download | iot-contact-60784a9ebaa6168b03851f359a83478c70c7dbeb.tar iot-contact-60784a9ebaa6168b03851f359a83478c70c7dbeb.tar.zst iot-contact-60784a9ebaa6168b03851f359a83478c70c7dbeb.zip |
tools: Add checksum check to download.sh
Diffstat (limited to 'tools/download.sh')
-rwxr-xr-x | tools/download.sh | 10 |
1 files changed, 9 insertions, 1 deletions
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 |