From 781aa18d07b2bd825ee6b9d5f99b1c8aa4056468 Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 22 Jan 2024 16:58:36 +0100 Subject: [PATCH] Update install.sh --- src/install.sh | 77 +++++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/src/install.sh b/src/install.sh index b11d8c1..e6bc516 100644 --- a/src/install.sh +++ b/src/install.sh @@ -39,40 +39,8 @@ if [[ "${VERSION,,}" == "tiny11" ]]; then VERSION="https://archive.org/download/tiny-11-core-x-64-beta-1/tiny11%20core%20x64%20beta%201.iso" fi -if [[ "${VERSION,,}" == "http"* ]]; then - EXTERNAL="Y" -else - EXTERNAL="N" -fi - -TMP="$STORAGE/tmp" -MSG="Windows is being started, please wait..." - -if [[ "$EXTERNAL" != [Yy1]* ]]; then - - BASE="$VERSION.iso" - - if [ ! -f "$STORAGE/$BASE" ]; then - MSG="Windows is being downloaded, please wait..." - fi - -else - - BASE=$(basename "${VERSION%%\?*}") - : "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}" - BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g') - - if [ ! -f "$STORAGE/$BASE" ]; then - MSG="Image '$BASE' is being downloaded, please wait..." - fi - -fi - -[[ "${BASE,,}" == "custom."* ]] && BASE="target.iso" - -html "$MSG" - CUSTOM="custom.iso" + [ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="Custom.iso" [ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="custom.ISO" [ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="CUSTOM.ISO" @@ -81,12 +49,50 @@ CUSTOM="custom.iso" [ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="custom.IMG" [ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="CUSTOM.IMG" +MSG="Windows is being started, please wait..." + 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" + + if [ ! -f "$STORAGE/$BASE" ]; then + MSG="Windows is being downloaded, please wait..." + fi + + else + + BASE=$(basename "${VERSION%%\?*}") + : "${BASE//+/ }"; printf -v BASE '%b' "${_//%/\\x}" + BASE=$(echo "$BASE" | sed -e 's/[^A-Za-z0-9._-]/_/g') + + if [ ! -f "$STORAGE/$BASE" ]; then + MSG="Image '$BASE' is being downloaded, please wait..." + fi + + fi + + [[ "${BASE,,}" == "custom."* ]] && BASE="target.iso" + fi +html "$MSG" +TMP="$STORAGE/tmp" + if [ -f "$STORAGE/$BASE" ]; then # Check if the ISO was already processed by our script @@ -99,7 +105,8 @@ if [ -f "$STORAGE/$BASE" ]; then fi CUSTOM="$BASE" - info "Custom ISO file '$BASE' needs to be prepared..." + MSG="ISO file '$BASE' needs to be prepared..." + info "$MSG" && html "$MSG" fi @@ -158,7 +165,7 @@ if (( SIZE > SPACE )); then fi if [ -n "$CUSTOM" ]; then - MSG="Extracting custom ISO image..." + MSG="Extracting local ISO image..." else MSG="Extracting downloaded ISO image..." fi