aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-03-21 10:59:36 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-03-21 10:59:36 -0500
commit8f0f88fbb420053e84a16d4408d9d768e000e2fc (patch)
tree95e261da1bc18b6f88bf85469f063e278fa96b8b
parent355567235c365064574fe1df8fafe1b4b979cdcd (diff)
Show only percentage at end of downloading line.
-rwxr-xr-xdownload.sh22
1 files changed, 16 insertions, 6 deletions
diff --git a/download.sh b/download.sh
index 9c610ff..b8a0c11 100755
--- a/download.sh
+++ b/download.sh
@@ -1,6 +1,18 @@
#!/bin/bash
# Packages
+
+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)}'
+ echo -ne "\b\b\b\b\n"
+ tput cnorm
+}
+
cat packages.csv patches.csv | while read line; do
NAME="$(echo $line | cut -d\, -f1)"
VERSION="$(echo $line | cut -d\, -f2)"
@@ -12,14 +24,12 @@ cat packages.csv patches.csv | while read line; do
echo -ne "${PRP}Downloading ${YLW}${CACHEFILE}${RST}... "
- wget -nc -q -O "${LFS_SRC}/${CACHEFILE}" "${URL}" & pid=$!
- spinner "$pid"
- if ! echo "${MD5SUM} ${LFS_SRC}/${CACHEFILE}" | md5sum -c > /dev/null 2>&1; then
+ #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 "}'
+ download ${URL}
+ if ! echo "${MD5SUM} ${LFS_SRC}/${CACHEFILE}" | md5sum -c > /dev/null 2>&1; then
rm -f "${LFS_SRC}/${CACHEFILE}"
echo -e "\n${GRN}Verification of ${YLW}${CACHEFILE} ${RED}failed! MD5 mismatch!${RST}"
exit 1
fi
-
- echo -e "${GRN}OK${RST}"
fi
-done \ No newline at end of file
+done