Update define.sh

This commit is contained in:
Kroese 2024-04-30 23:20:15 +02:00 committed by GitHub
parent cacb1e6fda
commit fb98999026
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -26,38 +26,6 @@ parseVersion() {
return 0
}
validVersion() {
local id="$1"
case "${id,,}" in
"win11${PLATFORM,,}")
return 0
;;
"win10${PLATFORM,,}")
return 0
;;
esac
return 1
}
isESD() {
local id="$1"
case "${id,,}" in
"win11${PLATFORM,,}")
return 0
;;
"win10${PLATFORM,,}")
return 0
;;
esac
return 1
}
printVersion() {
local id="$1"
@ -83,18 +51,10 @@ getName() {
[[ "${file,,}" == *"windows10"* ]] && desc="Windows 10"
[[ "${file,,}" == *"windows_11"* ]] && desc="Windows 11"
[[ "${file,,}" == *"windows_10"* ]] && desc="Windows 10"
[[ "${file,,}" == *"windows 11"* ]] && desc="Windows 11"
[[ "${file,,}" == *"windows 10"* ]] && desc="Windows 10"
if [ -z "$desc" ]; then
desc="Windows"
else
if [[ "$desc" == "Windows 1"* ]] && [[ "${file,,}" == *"_iot_"* ]]; then
desc="$desc IoT"
else
if [[ "$desc" == "Windows 1"* ]] && [[ "${file,,}" == *"_ltsc_"* ]]; then
desc="$desc LTSC"
fi
fi
fi
[ -z "$desc" ] && desc="Windows"
echo "$desc for ${PLATFORM}"
return 0
@ -112,28 +72,23 @@ getVersion() {
return 0
}
getLink() {
# Fallbacks for users who cannot connect to the Microsoft servers
isESD() {
local id="$1"
local url=""
local host="https://drive.massgrave.dev"
case "${id,,}" in
"win11${PLATFORM,,}")
url="$host/SW_DVD9_Win_Pro_11_23H2.2_Arm64_English_Pro_Ent_EDU_N_MLF_X23-68023.ISO"
return 0
;;
"win10${PLATFORM,,}")
url="$host/SW_DVD9_Win_Pro_10_22H2.15_Arm64_English_Pro_Ent_EDU_N_MLF_X23-67223.ISO"
return 0
;;
esac
echo "$url"
return 0
return 1
}
secondLink() {
getLink() {
# Fallbacks for users who cannot connect to the Microsoft servers
@ -154,4 +109,39 @@ secondLink() {
return 0
}
return 0
secondLink() {
# Fallbacks for users who cannot connect to the Microsoft servers
local id="$1"
local url=""
local host="https://drive.massgrave.dev"
case "${id,,}" in
"win11${PLATFORM,,}")
url="$host/SW_DVD9_Win_Pro_11_23H2.2_Arm64_English_Pro_Ent_EDU_N_MLF_X23-68023.ISO"
;;
"win10${PLATFORM,,}")
url="$host/SW_DVD9_Win_Pro_10_22H2.15_Arm64_English_Pro_Ent_EDU_N_MLF_X23-67223.ISO"
;;
esac
echo "$url"
return 0
}
validVersion() {
local id="$1"
local url
isESD "$id" && return 0
url=$(getLink "$id")
[ -n "$url" ] && return 0
url=$(secondLink "$id")
[ -n "$url" ] && return 0
return 1
}