mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-15 13:44:50 +08:00
Update windowsInit.sh
This commit is contained in:
parent
fbdcd99e72
commit
5414bd8a89
1 changed files with 9 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue