diff --git a/Linux_reinstall/Windows/windowsInit.sh b/Linux_reinstall/Windows/windowsInit.sh index fb049aa..043d058 100644 --- a/Linux_reinstall/Windows/windowsInit.sh +++ b/Linux_reinstall/Windows/windowsInit.sh @@ -69,16 +69,20 @@ mapperDevice=$(kpartx -av $loopDevice | grep "$loopDeviceNum" | head -n 1 | awk # mount Windows dd partition to /mnt ntfs-3g /dev/mapper/$mapperDevice /mnt +# download initiate file +setupCompleteFile='/mnt/Users/Administrator/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/SetupComplete.bat' +wget --no-check-certificate -qO "$setupCompleteFile" ''$windowsStaticConfigCmd'' + # write static config script to setup step -[[ "$Network4Config" == "isStatic" ]] && { - setupCompleteFile='/mnt/Users/Administrator/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/SetupComplete.bat' - wget --no-check-certificate -qO "$setupCompleteFile" ''$windowsStaticConfigCmd'' +if [[ "$Network4Config" == "isStatic" ]]; then sed -ri "s/IPv4/$IPv4/g" "$setupCompleteFile" sed -ri "s/actualIp4Subnet/$actualIp4Subnet/g" "$setupCompleteFile" sed -ri "s/GATE/$GATE/g" "$setupCompleteFile" sed -ri "s/ipDNS1/$ipDNS1/g" "$setupCompleteFile" sed -ri "s/ipDNS2/$ipDNS2/g" "$setupCompleteFile" -} +else + sed -ri "s/setmode=on/setmode=off/g" "$setupCompleteFile" +fi # Reboot, the system in the memory will all be written to the hard drive. -# exec reboot +exec reboot