diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-03-26 14:50:49 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-03-26 14:50:49 -0500 |
commit | 87ac58595266f0bafcef0c9a48ca2d40615c7434 (patch) | |
tree | df8f6d6216a7c441150e0fa5db78b94427812981 /download.sh | |
parent | 1db835499260d6deced9b9b9851503c78a4d8727 (diff) |
Provide wget exit status when download fails.
Diffstat (limited to 'download.sh')
-rw-r--r-- | download.sh | 5 |
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 } |