Update install.sh

This commit is contained in:
Kroese 2024-05-05 18:01:36 +02:00 committed by GitHub
parent 59403efbb2
commit 939b52dddc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -272,38 +272,6 @@ getESD() {
return 0
}
doMido() {
local iso="$1"
local version="$2"
local desc="$3"
local rc
rm -f "$iso"
rm -f "$iso.PART"
local msg="Downloading $desc..."
info "$msg" && html "$msg"
/run/progress.sh "$iso.PART" "" "Downloading $desc ([P])..." &
cd "$TMP"
{ /run/mido.sh "${version,,}"; rc=$?; } || :
cd /run
fKill "progress.sh"
if (( rc == 0 )) && [ -f "$iso" ]; then
if [ "$(stat -c%s "$iso")" -gt 100000000 ]; then
html "Download finished successfully..." && return 0
fi
fi
rm -f "$iso"
rm -f "$iso.PART"
return 1
}
verifyFile() {
local iso="$1"
@ -341,6 +309,43 @@ verifyFile() {
return 1
}
doMido() {
local iso="$1"
local version="$2"
local desc="$3"
local rc sum size total
rm -f "$iso"
rm -f "$iso.PART"
size=$(getMido "$version" "size")
sum=$(getMido "$version" "sum")
local msg="Downloading $desc..."
info "$msg" && html "$msg"
/run/progress.sh "$iso.PART" "$size" "Downloading $desc ([P])..." &
cd "$TMP"
{ /run/mido.sh "${version,,}"; rc=$?; } || :
cd /run
fKill "progress.sh"
if (( rc == 0 )) && [ -f "$iso" ]; then
total=$(stat -c%s "$iso")
if [ "$total" -gt 100000000 ]; then
! verifyFile "$iso" "$size" "$total" "$sum" && return 1
html "Download finished successfully..." && return 0
fi
fi
rm -f "$iso"
rm -f "$iso.PART"
return 1
}
downloadFile() {
local iso="$1"