Update install.sh

This commit is contained in:
Kroese 2024-01-22 13:01:54 +01:00 committed by GitHub
parent 8dfc48ca41
commit 6fb9b0a491
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -70,11 +70,23 @@ fi
[[ "${BASE,,}" == "custom."* ]] && BASE="target.iso"
html "$MSG"
CUSTOM="custom.iso"
TMP="$STORAGE/tmp"
if [ -f "$STORAGE/$BASE" ]; then
# Check if the ISO was already processed by our script
MAGIC=$(dd if="$STORAGE/$BASE" seek=0 bs=1 count=1 status=none)
MAGIC="$(printf '%s' "$MAGIC" | od -A n -t x1 -v | tr -d ' \n')"
if [[ "${MAGIC,,}" == "16" ]]; then
rm -rf "$TMP"
return 0
fi
info "ISO file "$STORAGE/$BASE" needs to be prepared..."
fi
mkdir -p "$TMP"
@ -82,8 +94,6 @@ mkdir -p "$TMP"
ISO="$TMP/$BASE"
rm -f "$ISO"
CUSTOM="custom.iso"
[ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="custom.img"
[ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="Custom.iso"
[ ! -f "$STORAGE/$CUSTOM" ] && CUSTOM="Custom.img"