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 auto="16"
local manual="17"
local byte="$auto"
[[ "$MANUAL" == [Yy1]* ]] && byte="$manual"
# 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="$(printf '%s' "$magic" | od -A n -t x1 -v | tr -d ' \n')"
if [[ "$magic" == "$auto" ]] || [[ "$magic" == "$manual" ]]; then
if [ -n "$CUSTOM" ] && [ -z "$ORIGINAL" ]; then
warn "this ISO file has already been modified by a previous installation!"
if [[ "$magic" == "$byte" ]]; then
if [ -z "$CUSTOM" ] || [ -n "$ORIGINAL" ]; then
return 1
fi
fi
local byte="$auto"
[[ "$MANUAL" == [Yy1]* ]] && byte="$manual"
[[ "$magic" == "$byte" ]] && return 1
fi
rm -rf "$TMP"
mkdir -p "$TMP"
if [ -z "$CUSTOM" ]; then
BOOT="$ISO"
ISO=$(basename "$ISO")
ISO="$TMP/$ISO"
if [ -f "$BOOT" ] && [ -s "$BOOT" ]; then
mv -f "$BOOT" "$ISO"
fi
else
if [ -n "$ORIGINAL" ]; then
@ -100,8 +105,6 @@ startInstall() {
fi
rm -f "$BOOT"
rm -rf "$TMP"
mkdir -p "$TMP"
return 0
}