diff options
Diffstat (limited to 'download.sh')
-rw-r--r-- | download.sh | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/download.sh b/download.sh index fff69f7..3b81896 100644 --- a/download.sh +++ b/download.sh @@ -1,28 +1,28 @@ -#!/bin/bash - -# Downlod Packages and Patches - -cat packages.csv patches.csv | while read -r 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 - printf "%b" "${PRP}Downloading ${YLW}${CACHEFILE}${RST}... " - download "${URL}" - else - printf "%b" "${PRP}File cached ${YLW}${CACHEFILE}${RST}... " - fi - - if ! echo "${MD5SUM} ${LFS}/sources/${CACHEFILE}" | md5sum -c > /dev/null 2>&1; then - rm -f "${LFS}/sources/${CACHEFILE}" - printf "%b" "\n${IPRP} MD5SUM ${YLW}${MD5SUM} " - fail "FAILED! MD5 MISMATCH!" - exit 1 - fi - printf "%b" "\n${IPRP} MD5SUM ${YLW}${MD5SUM} " - success "OK" - -done +#!/bin/bash
+
+# Downlod Packages and Patches
+
+cat packages.csv patches.csv | while read -r 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
+ printf "%b" "${PRP}Downloading ${YLW}${CACHEFILE}${RST}... "
+ download "${URL}"
+ else
+ printf "%b" "${PRP}File cached ${YLW}${CACHEFILE}${RST}... "
+ fi
+
+ if ! echo "${MD5SUM} ${LFS}/sources/${CACHEFILE}" | md5sum -c > /dev/null 2>&1; then
+ rm -f "${LFS}/sources/${CACHEFILE}"
+ printf "%b" "\n${IPRP} MD5SUM ${YLW}${MD5SUM} "
+ fail "FAILED! MD5 MISMATCH!"
+ exit 1
+ fi
+ printf "%b" "\n${IPRP} MD5SUM ${YLW}${MD5SUM} "
+ success "OK"
+
+done
|