fix: Find files case insensitive
This commit is contained in:
parent
691ad3c43b
commit
ae89a9bc4c
1 changed files with 5 additions and 35 deletions
|
|
@ -15,15 +15,8 @@ fi
|
|||
[[ "${VERSION,,}" == "10" ]] && VERSION="win10arm64"
|
||||
[[ "${VERSION,,}" == "win10" ]] && VERSION="win10arm64"
|
||||
|
||||
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=""
|
||||
TMP="$STORAGE/tmp"
|
||||
|
|
@ -72,31 +65,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
|
||||
|
|
@ -581,7 +549,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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue