diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-03-16 00:01:28 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-03-16 00:01:28 -0500 |
commit | 2704a1c0ce34d81fdde6d2c365df0b9a77545fc3 (patch) | |
tree | be16050026c3b0b2d821d8abf315408156c2fedf /download.sh | |
parent | 36bdd88a911512bf029d15a362a4de1da3d288fd (diff) |
Was forgotten.
Diffstat (limited to 'download.sh')
-rwxr-xr-x | download.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/download.sh b/download.sh new file mode 100755 index 0000000..a034cb6 --- /dev/null +++ b/download.sh @@ -0,0 +1,21 @@ +#!/bin/bash +source lfs.sh +cat packages.csv | while read line; do + NAME="$(echo $line | cut -d\, -f1)" + VERSION="$(echo $line | cut -d\, -f2)" + URL="$(echo $line | cut -d\, -f3 | sed "s/@/${VERSION}/g")" + MD5SUM="$(echo $line | cut -d\, -f4)" + CACHEFILE="$(basename "$URL")" + + if [ ! -f "${CACHEFILE}" ]; then + + + echo "Downloading ${URL}" + wget -nc -O "${LFS_SRC}/${CACHEFILE}" "${URL}" + if ! echo "${MD5SUM} ${LFS_SRC}/${CACHEFILE}" | md5sum -c >/dev/null; then + rm -f "${LFS_SRC}/${CACHEFILE}" + echo "Verification of ${CACHEFILE} failed! MD5 mismatch!" + exit 1 + fi + fi +done
\ No newline at end of file |