diff options
author | xengineering <me@xengineering.eu> | 2024-06-07 17:40:14 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-06-07 17:40:14 +0200 |
commit | d8f8de953044328932836a450cbb4157736ba2d2 (patch) | |
tree | b19ccc6bea3309e41adab695fdff8b2bacd81c8d /tools/download.sh | |
parent | 2b38114643b68670092d6c389c51a0ae01d50e04 (diff) | |
download | iot-contact-d8f8de953044328932836a450cbb4157736ba2d2.tar iot-contact-d8f8de953044328932836a450cbb4157736ba2d2.tar.zst iot-contact-d8f8de953044328932836a450cbb4157736ba2d2.zip |
tools: Add download.sh to get external doc files
It is unknown if it would be legal to include those external documents
like datasheets inside this Git repository. Thus the added script
provides the ability to get them directly from the vendor.
Diffstat (limited to 'tools/download.sh')
-rwxr-xr-x | tools/download.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/download.sh b/tools/download.sh new file mode 100755 index 0000000..901fd3f --- /dev/null +++ b/tools/download.sh @@ -0,0 +1,35 @@ +#!/bin/sh + + +set -euf + + +# absolute paths +script="$(realpath $0)" +tools="$(dirname "${script}")" +src="$(dirname "${tools}")" +doc="${src}/doc" + +documents=' +ft232r.pdf https://www.ftdichip.com/old2020/Support/Documents/DataSheets/ICs/DS_FT232R.pdf +' + + +mkdir -pv "$doc" + +echo "$documents" | while read line +do + if [ "$line" == '' ] + then + continue + fi + + name="$(echo "$line" | cut -d$'\t' -f1)" + url="$(echo "$line" | cut -d$'\t' -f2)" + path="${doc}/${name}" + + if [ ! -f "$path" ] + then + curl "$url" > "$path" + fi +done |