Update install.sh

This commit is contained in:
Kroese 2024-05-10 16:01:32 +02:00 committed by GitHub
parent 197db74721
commit 5bfcb0c2cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,29 +62,34 @@ startInstall() {
local magic local magic
local auto="16" local auto="16"
local manual="17" local manual="17"
local byte="$auto"
[[ "$MANUAL" == [Yy1]* ]] && byte="$manual"
# Check if the ISO was already processed by our script # Check if the ISO was already processed by our script
magic=$(dd if="$ISO" seek=0 bs=1 count=1 status=none | tr -d '\000') magic=$(dd if="$ISO" seek=0 bs=1 count=1 status=none | tr -d '\000')
magic="$(printf '%s' "$magic" | od -A n -t x1 -v | tr -d ' \n')" magic="$(printf '%s' "$magic" | od -A n -t x1 -v | tr -d ' \n')"
if [[ "$magic" == "$auto" ]] || [[ "$magic" == "$manual" ]]; then if [[ "$magic" == "$byte" ]]; then
if [ -n "$CUSTOM" ] && [ -z "$ORIGINAL" ]; then if [ -z "$CUSTOM" ] || [ -n "$ORIGINAL" ]; then
warn "this ISO file has already been modified by a previous installation!" return 1
fi fi
fi fi
local byte="$auto"
[[ "$MANUAL" == [Yy1]* ]] && byte="$manual"
[[ "$magic" == "$byte" ]] && return 1
fi fi
rm -rf "$TMP"
mkdir -p "$TMP"
if [ -z "$CUSTOM" ]; then if [ -z "$CUSTOM" ]; then
BOOT="$ISO" BOOT="$ISO"
ISO=$(basename "$ISO") ISO=$(basename "$ISO")
ISO="$TMP/$ISO" ISO="$TMP/$ISO"
if [ -f "$BOOT" ] && [ -s "$BOOT" ]; then
mv -f "$BOOT" "$ISO"
fi
else else
if [ -n "$ORIGINAL" ]; then if [ -n "$ORIGINAL" ]; then
@ -100,8 +105,6 @@ startInstall() {
fi fi
rm -f "$BOOT" rm -f "$BOOT"
rm -rf "$TMP"
mkdir -p "$TMP"
return 0 return 0
} }