Update install.sh

This commit is contained in:
Kroese 2024-04-29 04:16:28 +02:00 committed by GitHub
parent 64d405256d
commit 7df17285c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -314,50 +314,44 @@ downloadImage() {
local iso="$1" local iso="$1"
local version="$2" local version="$2"
local url=""
local tried="n" local tried="n"
local rc desc local url desc
if [[ "${version,,}" == "http"* ]]; then if [[ "${version,,}" == "http"* ]]; then
url="$version"
desc=$(getName "$BASE" "$BASE") desc=$(getName "$BASE" "$BASE")
downloadFile "$iso" "$version" "$desc" && return 0
else return 1
if ! validVersion "$version"; then
error "Invalid VERSION value: $version" && return 1
fi
desc=$(printVersion "$version" "Windows")
if isMido "$version"; then
tried="y"
doMido "$iso" "$version" "$desc" && return 0
fi
if isESD "$version"; then
[[ "$tried" != "n" ]] && info "Failed to download $desc using Mido, will try a different method now..."
ISO="$TMP/$version.esd"
iso="$ISO"
tried="y"
rm -rf "$TMP"
mkdir -p "$TMP"
getESD "$TMP/esd" "$version" && url="$ESD_URL"
fi
fi fi
if [ -n "$url" ]; then if ! validVersion "$version"; then
downloadFile "$iso" "$url" "$desc" && return 0 error "Invalid VERSION value: $version" && return 1
fi fi
[[ "${version,,}" == "http"* ]] && return 1 desc=$(printVersion "$version" "Windows")
if isMido "$version"; then
tried="y"
doMido "$iso" "$version" "$desc" && return 0
fi
if isESD "$version"; then
[[ "$tried" != "n" ]] && info "Failed to download $desc using Mido, will try a different method now..."
ISO="$TMP/$version.esd"
iso="$ISO"
tried="y"
rm -rf "$TMP"
mkdir -p "$TMP"
if getESD "$TMP/esd" "$version"; then
downloadFile "$iso" "$ESD_URL" "$desc" && return 0
fi
fi
ISO="$TMP/$BASE" ISO="$TMP/$BASE"
iso="$ISO" iso="$ISO"