mirror of
https://github.com/dockur/windows.git
synced 2025-03-29 13:08:15 +00:00
feat: Check if IP is specified (#1135)
This commit is contained in:
parent
e5e71f67fa
commit
522d646fa3
@ -1300,6 +1300,9 @@ prepareInstall() {
|
|||||||
[ -n "$PASSWORD" ] && password="$PASSWORD"
|
[ -n "$PASSWORD" ] && password="$PASSWORD"
|
||||||
[ -n "$USERNAME" ] && username=$(echo "$USERNAME" | sed 's/[^[:alnum:]@!._-]//g')
|
[ -n "$USERNAME" ] && username=$(echo "$USERNAME" | sed 's/[^[:alnum:]@!._-]//g')
|
||||||
|
|
||||||
|
local ip="20.20.20.1"
|
||||||
|
[ -n "${VM_NET_IP:-}" ] && ip="${VM_NET_IP%.*}.1"
|
||||||
|
|
||||||
# These are not pirated keys, they come from the official MS documentation.
|
# These are not pirated keys, they come from the official MS documentation.
|
||||||
if [[ "${driver,,}" == "xp" ]]; then
|
if [[ "${driver,,}" == "xp" ]]; then
|
||||||
if [[ "${arch,,}" == "x86" ]]; then
|
if [[ "${arch,,}" == "x86" ]]; then
|
||||||
@ -1494,7 +1497,7 @@ prepareInstall() {
|
|||||||
echo "Set oFSO = CreateObject(\"Scripting.FileSystemObject\")"
|
echo "Set oFSO = CreateObject(\"Scripting.FileSystemObject\")"
|
||||||
echo "Set oHosts = oFSO.GetFile(\"C:\Windows\System32\drivers\etc\hosts\")"
|
echo "Set oHosts = oFSO.GetFile(\"C:\Windows\System32\drivers\etc\hosts\")"
|
||||||
echo "Set fileAPPEND = oFSO.OpenTextFile(\"C:\Windows\System32\drivers\etc\hosts\", 8, true)"
|
echo "Set fileAPPEND = oFSO.OpenTextFile(\"C:\Windows\System32\drivers\etc\hosts\", 8, true)"
|
||||||
echo "fileAPPEND.Write(\"${VM_NET_IP%.*}.1 host.lan\")"
|
echo "fileAPPEND.Write(\"$ip host.lan\")"
|
||||||
echo "fileAPPEND.Close()"
|
echo "fileAPPEND.Close()"
|
||||||
echo ""
|
echo ""
|
||||||
} | unix2dos > "$dir/\$OEM\$/admin.vbs"
|
} | unix2dos > "$dir/\$OEM\$/admin.vbs"
|
||||||
|
@ -628,7 +628,9 @@ updateXML() {
|
|||||||
local language="$2"
|
local language="$2"
|
||||||
local culture region user admin pass keyboard
|
local culture region user admin pass keyboard
|
||||||
|
|
||||||
sed -i "s/ 20.20.20.1 / ${VM_NET_IP%.*}.1 /g" "$asset"
|
if [ -n "${VM_NET_IP:-}" ]; then
|
||||||
|
sed -i "s/ 20.20.20.1 / ${VM_NET_IP%.*}.1 /g" "$asset"
|
||||||
|
fi
|
||||||
|
|
||||||
[ -z "$HEIGHT" ] && HEIGHT="720"
|
[ -z "$HEIGHT" ] && HEIGHT="720"
|
||||||
[ -z "$WIDTH" ] && WIDTH="1280"
|
[ -z "$WIDTH" ] && WIDTH="1280"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user