aboutsummaryrefslogtreecommitdiffstats
path: root/download.sh
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-03-26 14:50:49 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-03-26 14:50:49 -0500
commit87ac58595266f0bafcef0c9a48ca2d40615c7434 (patch)
treedf8f6d6216a7c441150e0fa5db78b94427812981 /download.sh
parent1db835499260d6deced9b9b9851503c78a4d8727 (diff)
Provide wget exit status when download fails.
Diffstat (limited to 'download.sh')
-rw-r--r--download.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/download.sh b/download.sh
index 9b3da10..4e3c794 100644
--- a/download.sh
+++ b/download.sh
@@ -9,6 +9,11 @@ download()
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
}