diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-03-26 15:03:25 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-03-26 15:03:25 -0500 |
commit | 50b67be7e409161f5c6f4847ca2beb23e81b51ae (patch) | |
tree | f3442572461e62d27e28ed8b83199e60a95e2962 /download.sh | |
parent | 87ac58595266f0bafcef0c9a48ca2d40615c7434 (diff) |
Create a script exporting separate functions and remove download function from downloads script. Reformat MD5 mismatch failed message.
Diffstat (limited to 'download.sh')
-rw-r--r-- | download.sh | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/download.sh b/download.sh index 4e3c794..2cec438 100644 --- a/download.sh +++ b/download.sh @@ -2,22 +2,6 @@ # Downlod Packages and Patches -download() -{ - tput civis - local url=$1 - echo -n " " - wget -nc -q --show-progress --progress=dot "$url" 2>&1 | grep --line-buffered "%" | \ - sed -u -e "s,\.,,g" | awk '{printf("\b\b\b\b%4s", $2)}' - local retval="${PIPESTATUS[0]}" - if [ "${retval}" -ne 0 ]; then - printf "%b" "${RED}FAILED! WGET EXIT (${retval})\n${RST}" - exit "${retval}" - fi - printf "%b" "\b\b\b\b\n" - tput cnorm -} - cat packages.csv patches.csv | while read -r line; do #NAME="$(echo "$line" | cut -d\, -f1)" VERSION="$(echo "$line" | cut -d\, -f2)" @@ -32,7 +16,7 @@ cat packages.csv patches.csv | while read -r line; do download "${URL}" if ! echo "${MD5SUM} ${LFS}/sources/${CACHEFILE}" | md5sum -c > /dev/null 2>&1; then rm -f "${LFS}/sources/${CACHEFILE}" - printf "%b" "\n${GRN}Verification of ${YLW}${CACHEFILE} ${RED}FAILED! MD5 MISMATCH!${RST}\n" + printf "%b" "${GRN}Verification of ${YLW}${CACHEFILE} ${RED}FAILED! MD5 MISMATCH!${RST}\n" exit 1 fi fi |