diff --git a/quickget b/quickget index 250fe38..64b7a82 100755 --- a/quickget +++ b/quickget @@ -25,6 +25,17 @@ function cleanup() { fi } +if [ "${1}" == '-t' ]; then + testmode="on" + if [ -n "$4" ]; then + set -- "$2" "$3" "$4" + elif [ -n "$3" ]; then + set -- "$2" "$3" + else + set -- "$2" + fi +fi + function pretty_name() { local SIMPLE_NAME="" local PRETTY_NAME="" @@ -797,6 +808,9 @@ function editions_zorin() { } function check_hash() { + if [ "${testmode}" == 'on' ]; then + exit 0 + fi local iso="" local hash="" local hash_algo="" @@ -846,6 +860,11 @@ function web_get() { exit 1 fi echo #Necessary as aria2c in suppressed mode does not have new lines +# Test mode for ISO (yet wget only) + elif [ "${testmode}" == 'on' ]; then + echo "${URL}" + #wget --spider "${URL}" + exit 1 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."