Update install.sh

This commit is contained in:
Kroese 2024-01-29 04:30:39 +01:00 committed by GitHub
parent 8792ea0489
commit eaeb1c8d12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -264,35 +264,35 @@ downloadImage() {
local iso="$1" local iso="$1"
local url="$2" local url="$2"
local msg desc progress local file="$iso"
local finish="Download finished successfully..." local desc="$BASE"
local rc progress
rm -f "$iso" rm -f "$iso"
if [[ "$EXTERNAL" != [Yy1]* ]]; then if [[ "$EXTERNAL" != [Yy1]* ]]; then
file="$iso.PART"
desc=$(printVersion "$VERSION") desc=$(printVersion "$VERSION")
[ -z "$desc" ] && desc="Windows" [ -z "$desc" ] && desc="Windows"
msg="Downloading $desc..."
fi
local msg="Downloading $desc..."
info "$msg" && html "$msg" info "$msg" && html "$msg"
/run/progress.sh "$iso.PART" "Downloading $desc ([P])..." &
/run/progress.sh "$file" "Downloading $desc ([P])..." &
if [[ "$EXTERNAL" != [Yy1]* ]]; then
cd "$TMP" cd "$TMP"
if ! /run/mido.sh "$url"; then { /run/mido.sh "$url"; rc=$?; } || :
fKill "progress.sh"
return 1
fi
cd /run cd /run
fKill "progress.sh" fKill "progress.sh"
[ ! -f "$iso" ] && return 1 (( rc != 0 )) && return 1
html "$finish" else
return 0
fi
msg="Downloading $BASE ..."
info "$msg" && html "$msg"
# Check if running with interactive TTY or redirected to docker log # Check if running with interactive TTY or redirected to docker log
if [ -t 1 ]; then if [ -t 1 ]; then
@ -301,14 +301,16 @@ downloadImage() {
progress="--progress=dot:giga" progress="--progress=dot:giga"
fi fi
/run/progress.sh "$iso" "Downloading $BASE ([P])..." &
{ wget "$url" -O "$iso" -q --no-check-certificate --show-progress "$progress"; rc=$?; } || : { wget "$url" -O "$iso" -q --no-check-certificate --show-progress "$progress"; rc=$?; } || :
fKill "progress.sh" fKill "progress.sh"
(( rc != 0 )) && error "Failed to download $url , reason: $rc" && exit 60 (( rc != 0 )) && error "Failed to download $url , reason: $rc" && exit 60
fi
[ ! -f "$iso" ] && return 1 [ ! -f "$iso" ] && return 1
html "$finish" html "Download finished successfully..."
return 0 return 0
} }