mirror of
https://github.com/dockur/windows.git
synced 2025-10-29 20:25:49 +00:00
Update install.sh
This commit is contained in:
parent
197db74721
commit
5bfcb0c2cc
1 changed files with 12 additions and 9 deletions
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue