From 0dcbe75fb58ad43a92c8b166c4546a59a97cc132 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Mon, 27 Sep 2021 22:47:10 +0100 Subject: [PATCH] Refactor web_get() and add progress --- quickemu | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/quickemu b/quickemu index 5fe8637..d9cda48 100755 --- a/quickemu +++ b/quickemu @@ -5,12 +5,10 @@ function web_get() { local URL="${1}" local FILE="" FILE="${URL##*/}" - if [ ! -e "${VMDIR}/${FILE}" ]; then - mkdir -p "${VMDIR}" 2>/dev/null - if ! wget -q -c "${URL}" -O "${VMDIR}/${FILE}"; then - echo "ERROR! Failed to download ${URL}" - exit 1 - fi + mkdir -p "${VMDIR}" 2>/dev/null + if ! wget --quiet --continue --show-progress --progress=bar:force:noscroll "${URL}" -O "${VMDIR}/${FILE}"; then + echo "ERROR! Failed to download ${URL}" + exit 1 fi }