mirror of
https://github.com/dockur/windows.git
synced 2025-10-29 12:15:50 +00:00
Update install.sh
This commit is contained in:
parent
0cb936d64d
commit
242eee4e3a
1 changed files with 26 additions and 19 deletions
|
|
@ -160,30 +160,36 @@ abortInstall() {
|
||||||
|
|
||||||
detectCustom() {
|
detectCustom() {
|
||||||
|
|
||||||
|
local file=""
|
||||||
|
local size base
|
||||||
|
|
||||||
CUSTOM=""
|
CUSTOM=""
|
||||||
local file size
|
|
||||||
|
|
||||||
if [[ "${VERSION,,}" != "http"* ]]; then
|
if [[ "${VERSION,,}" != "http"* ]]; then
|
||||||
file="${VERSION/\/storage\//}"
|
base="${VERSION/\/storage\//}"
|
||||||
[[ "$file" == "."* ]] && file="${file:1}"
|
[[ "$base" == "."* ]] && base="${file:1}"
|
||||||
[[ "$file" == *"/"* ]] && file=""
|
[[ "$base" == *"/"* ]] && base=""
|
||||||
[ -n "$file" ] && CUSTOM=$(find "$STORAGE" -maxdepth 1 -type f -iname "$file" -printf "%f\n" | head -n 1)
|
[ -n "$base" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "$base" -printf "%f\n" | head -n 1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z "$CUSTOM" ] && CUSTOM=$(find "$STORAGE" -maxdepth 1 -type f -iname custom.iso -printf "%f\n" | head -n 1)
|
[ -z "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname custom.iso -printf "%f\n" | head -n 1)
|
||||||
[ -z "$CUSTOM" ] && CUSTOM=$(find "$STORAGE" -maxdepth 1 -type f -iname custom.img -printf "%f\n" | head -n 1)
|
[ -z "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname custom.img -printf "%f\n" | head -n 1)
|
||||||
[ -z "$CUSTOM" ] && return 0
|
[ -n "$file" ] && file="$STORAGE/$file"
|
||||||
|
|
||||||
size="$(stat -c%s "$STORAGE/$CUSTOM")"
|
base="/custom.iso"
|
||||||
|
[ -f "$base" ] && [ -s "$base" ] && file="$base"
|
||||||
|
|
||||||
if [ -z "$size" ] || [[ "$size" == "0" ]]; then
|
[ -z "$file" ] && return 0
|
||||||
CUSTOM=""
|
[ ! -f "$file" ] && return 0
|
||||||
return 0
|
[ ! -s "$file" ] && return 0
|
||||||
fi
|
|
||||||
|
size="$(stat -c%s "$file")"
|
||||||
|
[ -z "$size" ] || [[ "$size" == "0" ]] && return 0
|
||||||
|
|
||||||
file="windows.$size.iso"
|
base="$STORAGE/windows.$size.iso"
|
||||||
[ -s "$STORAGE/$file" ] && CUSTOM="$file"
|
[ -f "$base" ] && [ -s "$base" ] && file="$base"
|
||||||
|
|
||||||
|
CUSTOM="$file"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -574,7 +580,10 @@ setXML() {
|
||||||
|
|
||||||
[[ "$MANUAL" == [Yy1]* ]] && return 0
|
[[ "$MANUAL" == [Yy1]* ]] && return 0
|
||||||
|
|
||||||
local file="$STORAGE/custom.xml"
|
local file="/custom.xml"
|
||||||
|
[ -f "$file" ] && [ -s "$file" ] && XML="$file" && return 0
|
||||||
|
|
||||||
|
file="$STORAGE/custom.xml"
|
||||||
[ -f "$file" ] && [ -s "$file" ] && XML="$file" && return 0
|
[ -f "$file" ] && [ -s "$file" ] && XML="$file" && return 0
|
||||||
|
|
||||||
file="/run/assets/custom.xml"
|
file="/run/assets/custom.xml"
|
||||||
|
|
@ -801,10 +810,8 @@ copyOEM() {
|
||||||
local src
|
local src
|
||||||
|
|
||||||
[ ! -d "$folder" ] && folder="/OEM"
|
[ ! -d "$folder" ] && folder="/OEM"
|
||||||
|
[ ! -d "$folder" ] && folder="$STORAGE/oem"
|
||||||
[ ! -d "$folder" ] && folder="$STORAGE/OEM"
|
[ ! -d "$folder" ] && folder="$STORAGE/OEM"
|
||||||
[ ! -d "$folder" ] && folder="$STORAGE/OEM"
|
|
||||||
[ ! -d "$folder" ] && folder="$STORAGE/shared/oem"
|
|
||||||
[ ! -d "$folder" ] && folder="$STORAGE/shared/OEM"
|
|
||||||
[ ! -d "$folder" ] && return 0
|
[ ! -d "$folder" ] && return 0
|
||||||
|
|
||||||
local msg="Copying OEM folder to image..."
|
local msg="Copying OEM folder to image..."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue