mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
testmode web_get
This commit is contained in:
parent
a1679d2566
commit
58e69834cb
1 changed files with 19 additions and 0 deletions
19
quickget
19
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."
|
||||
|
|
Loading…
Reference in a new issue