diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-03-22 19:38:17 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-03-22 19:38:17 -0500 |
commit | 13c5959df9257b68ec47d7a9e86212105a33bac8 (patch) | |
tree | 910a2933485a542ae375da19c427d68fc4e04e9f | |
parent | 98c92dc978dde707da3dd54f9b569b070f5cb500 (diff) |
Add a percentage count while downloading tarball and if md5sum doesn't match, rm the downloaded file.
-rw-r--r-- | download.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/download.sh b/download.sh index 7fd9d47..4154c75 100644 --- a/download.sh +++ b/download.sh @@ -22,10 +22,10 @@ cat packages.csv patches.csv | while read line; do echo -ne "${PRP}Downloading ${YLW}${CACHEFILE}${RST}... " - #wget -nc ${URL} -O ${LFS_SRC}/${CACHEFILE} --progress=dot -q --show-progress 2>&1 | awk 'NF>2 && $(NF-2) ~ /%/{printf "\r \t\t\t\t\t\t%s",$(NF-2)} END{print "\r "}' + #wget -nc ${URL} -O ${LFS}/sources/${CACHEFILE} --progress=dot -q --show-progress 2>&1 | awk 'NF>2 && $(NF-2) ~ /%/{printf "\r \t\t\t\t\t\t%s",$(NF-2)} END{print "\r "}' download ${URL} - if ! echo "${MD5SUM} ${LFS_SRC}/${CACHEFILE}" | md5sum -c > /dev/null 2>&1; then - rm -f "${LFS_SRC}/${CACHEFILE}" + if ! echo "${MD5SUM} ${LFS}/sources/${CACHEFILE}" | md5sum -c > /dev/null 2>&1; then + rm -f "${LFS}/sources/${CACHEFILE}" echo -e "\n${GRN}Verification of ${YLW}${CACHEFILE} ${RED}failed! MD5 mismatch!${RST}" exit 1 fi |