fix: Match files case insensitive

This commit is contained in:
Kroese 2024-02-16 13:25:21 +01:00 committed by GitHub
parent 2b1e43ac21
commit 381a177880
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,15 +90,8 @@ if [[ "${VERSION,,}" == "tiny10" ]]; then
VERSION="https://archive.org/download/tiny-10-23-h2/tiny10%20x64%2023h2.iso"
fi
CUSTOM="custom.iso"
[ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="Custom.iso"
[ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="custom.ISO"
[ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="CUSTOM.ISO"
[ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="custom.img"
[ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="Custom.img"
[ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="custom.IMG"
[ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="CUSTOM.IMG"
CUSTOM=$(find "$STORAGE" -maxdepth 1 -type f -iname custom.iso | head -n 1 | xargs basename)
[ -z "$CUSTOM" ] && CUSTOM=$(find "$STORAGE" -maxdepth 1 -type f -iname custom.img | head -n 1 | xargs basename)
ESD_URL=""
MACHINE="q35"
@ -205,31 +198,6 @@ getVersion() {
return 0
}
replaceXML() {
local dir="$1"
local asset="$2"
local path="$dir/autounattend.xml"
[ -f "$path" ] && cp "$asset" "$path"
path="$dir/Autounattend.xml"
[ -f "$path" ] && cp "$asset" "$path"
path="$dir/AutoUnattend.xml"
[ -f "$path" ] && cp "$asset" "$path"
path="$dir/autounattend.XML"
[ -f "$path" ] && cp "$asset" "$path"
path="$dir/Autounattend.XML"
[ -f "$path" ] && cp "$asset" "$path"
path="$dir/AutoUnattend.XML"
[ -f "$path" ] && cp "$asset" "$path"
path="$dir/AUTOUNATTEND.xml"
[ -f "$path" ] && cp "$asset" "$path"
path="$dir/AUTOUNATTEND.XML"
[ -f "$path" ] && cp "$asset" "$path"
return 0
}
hasDisk() {
[ -b "${DEVICE:-}" ] && return 0
@ -916,7 +884,9 @@ updateImage() {
local index result
[ ! -f "$asset" ] && return 0
replaceXML "$dir" "$asset"
local path=$(find "$dir" -maxdepth 1 -type f -iname autounattend.xml | head -n 1)
[ -n "$path" ] && cp "$asset" "$path"
local loc="$dir/sources/boot.wim"
[ ! -f "$loc" ] && loc="$dir/sources/boot.esd"