Update install.sh

This commit is contained in:
Kroese 2024-01-22 16:58:36 +01:00 committed by GitHub
parent 57a3585552
commit 781aa18d07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -39,16 +39,34 @@ if [[ "${VERSION,,}" == "tiny11" ]]; then
VERSION="https://archive.org/download/tiny-11-core-x-64-beta-1/tiny11%20core%20x64%20beta%201.iso" VERSION="https://archive.org/download/tiny-11-core-x-64-beta-1/tiny11%20core%20x64%20beta%201.iso"
fi fi
if [[ "${VERSION,,}" == "http"* ]]; then CUSTOM="custom.iso"
EXTERNAL="Y"
else [ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="Custom.iso"
EXTERNAL="N" [ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="custom.ISO"
fi [ ! -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"
TMP="$STORAGE/tmp"
MSG="Windows is being started, please wait..." MSG="Windows is being started, please wait..."
if [[ "$EXTERNAL" != [Yy1]* ]]; then if [ -f "$STORAGE/$CUSTOM" ]; then
EXTERNAL="N"
BASE="$CUSTOM"
else
CUSTOM=""
if [[ "${VERSION,,}" == "http"* ]]; then
EXTERNAL="Y"
else
EXTERNAL="N"
fi
if [[ "$EXTERNAL" != [Yy1]* ]]; then
BASE="$VERSION.iso" BASE="$VERSION.iso"
@ -56,7 +74,7 @@ if [[ "$EXTERNAL" != [Yy1]* ]]; then
MSG="Windows is being downloaded, please wait..." MSG="Windows is being downloaded, please wait..."
fi fi
else else
BASE=$(basename "${VERSION%%\?*}") BASE=$(basename "${VERSION%%\?*}")
: "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}" : "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}"
@ -66,26 +84,14 @@ else
MSG="Image '$BASE' is being downloaded, please wait..." MSG="Image '$BASE' is being downloaded, please wait..."
fi fi
fi fi
[[ "${BASE,,}" == "custom."* ]] && BASE="target.iso" [[ "${BASE,,}" == "custom."* ]] && BASE="target.iso"
fi
html "$MSG" html "$MSG"
TMP="$STORAGE/tmp"
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"
if [ -f "$STORAGE/$CUSTOM" ]; then
BASE="$CUSTOM"
else
CUSTOM=""
fi
if [ -f "$STORAGE/$BASE" ]; then if [ -f "$STORAGE/$BASE" ]; then
@ -99,7 +105,8 @@ if [ -f "$STORAGE/$BASE" ]; then
fi fi
CUSTOM="$BASE" CUSTOM="$BASE"
info "Custom ISO file '$BASE' needs to be prepared..." MSG="ISO file '$BASE' needs to be prepared..."
info "$MSG" && html "$MSG"
fi fi
@ -158,7 +165,7 @@ if (( SIZE > SPACE )); then
fi fi
if [ -n "$CUSTOM" ]; then if [ -n "$CUSTOM" ]; then
MSG="Extracting custom ISO image..." MSG="Extracting local ISO image..."
else else
MSG="Extracting downloaded ISO image..." MSG="Extracting downloaded ISO image..."
fi fi