From 961a8a18205f2d469efda479f29f3b6a436422ef Mon Sep 17 00:00:00 2001 From: Jai A P Date: Fri, 17 Nov 2023 05:06:59 +0530 Subject: [PATCH] Fix -s/-t flags still downloading isos (#846) * Fix -s/-t flags * Update quickget * Typo --- quickget | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/quickget b/quickget index abfbe3d..7923338 100755 --- a/quickget +++ b/quickget @@ -916,25 +916,23 @@ function web_get() { exit 1 fi - if command -v aria2c &>/dev/null; then + # Test mode for ISO + if [ "${show_iso_url}" == 'on' ]; then + echo "${URL}" + exit 0 + elif [ "${test_iso_url}" == 'on' ]; then + wget --spider "${URL}" + exit 0 + elif command -v aria2c &>/dev/null; then if ! aria2c --stderr -x16 --continue=true --summary-interval=0 --download-result=hide --console-log-level=error "${URL}" --dir "${DIR}" -o "${FILE}"; then echo #Necessary as aria2c in suppressed mode does not have new lines echo "ERROR! Failed to download ${URL} with aria2c. Try running 'quickget' again." exit 1 fi echo #Necessary as aria2c in suppressed mode does not have new lines - # Test mode for ISO (yet wget only) - elif [ "${show_iso_url}" == 'on' ]; then - echo "${URL}" - exit 0 - elif [ "${test_iso_url}" == 'on' ]; then - wget --spider "${URL}" - exit 0 - else - if ! wget --quiet --continue --tries=3 --read-timeout=10 --show-progress --progress=bar:force:noscroll "${URL}" -O "${DIR}/${FILE}"; then - echo "ERROR! Failed to download ${URL} with wget. Try running 'quickget' again." - exit 1 - fi + elif ! wget --quiet --continue --tries=3 --read-timeout=10 --show-progress --progress=bar:force:noscroll "${URL}" -O "${DIR}/${FILE}"; then + echo "ERROR! Failed to download ${URL} with wget. Try running 'quickget' again." + exit 1 fi } @@ -944,7 +942,14 @@ function zsync_get() { local OUT="" local URL="${1}" - if command -v zsync &>/dev/null; then + # Test mode for ISO + if [ "${show_iso_url}" == 'on' ]; then + echo "${URL}" + exit 0 + elif [ "${test_iso_url}" == 'on' ]; then + wget --spider "${URL}" + exit 0 + elif command -v zsync &>/dev/null; then if [ -n "${3}" ]; then OUT="${3}" else