mirror of
https://github.com/leitbogioro/Tools.git
synced 2025-10-19 19:55:54 +08:00
Update windowsInit.sh
This commit is contained in:
parent
924a71c0e9
commit
8e29108304
1 changed files with 15 additions and 3 deletions
|
@ -34,6 +34,7 @@ ip6DNS2=$(grep "ip6DNS2" $confFile | awk '{print $2}')
|
||||||
DDURL=$(grep "DDURL" $confFile | awk '{print $2}')
|
DDURL=$(grep "DDURL" $confFile | awk '{print $2}')
|
||||||
windowsStaticConfigCmd=$(grep "windowsStaticConfigCmd" $confFile | awk '{print $2}')
|
windowsStaticConfigCmd=$(grep "windowsStaticConfigCmd" $confFile | awk '{print $2}')
|
||||||
Network4Config=$(grep "Network4Config" $confFile | awk '{print $2}')
|
Network4Config=$(grep "Network4Config" $confFile | awk '{print $2}')
|
||||||
|
Network6Config=$(grep "Network6Config" $confFile | awk '{print $2}')
|
||||||
DEC_CMD=$(grep "DEC_CMD" $confFile | awk '{print $2}')
|
DEC_CMD=$(grep "DEC_CMD" $confFile | awk '{print $2}')
|
||||||
|
|
||||||
# Reset configurations of repositories.
|
# Reset configurations of repositories.
|
||||||
|
@ -73,15 +74,26 @@ ntfs-3g /dev/mapper/$mapperDevice /mnt
|
||||||
setupCompleteFile='/mnt/Users/Administrator/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/SetupComplete.bat'
|
setupCompleteFile='/mnt/Users/Administrator/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/SetupComplete.bat'
|
||||||
wget --no-check-certificate -qO "$setupCompleteFile" ''$windowsStaticConfigCmd''
|
wget --no-check-certificate -qO "$setupCompleteFile" ''$windowsStaticConfigCmd''
|
||||||
|
|
||||||
# Write static config script to setup step.
|
# Write IPv4 static config script to setup step.
|
||||||
if [[ "$Network4Config" == "isStatic" ]]; then
|
if [[ "$Network4Config" == "isStatic" && -n "$IPv4" && -n "$actualIp4Subnet" && -n "$GATE" ]]; then
|
||||||
sed -ri "s/IPv4/$IPv4/g" "$setupCompleteFile"
|
sed -ri "s/IPv4/$IPv4/g" "$setupCompleteFile"
|
||||||
sed -ri "s/actualIp4Subnet/$actualIp4Subnet/g" "$setupCompleteFile"
|
sed -ri "s/actualIp4Subnet/$actualIp4Subnet/g" "$setupCompleteFile"
|
||||||
sed -ri "s/GATE/$GATE/g" "$setupCompleteFile"
|
sed -ri "s/GATE/$GATE/g" "$setupCompleteFile"
|
||||||
sed -ri "s/ipDNS1/$ipDNS1/g" "$setupCompleteFile"
|
sed -ri "s/ipDNS1/$ipDNS1/g" "$setupCompleteFile"
|
||||||
sed -ri "s/ipDNS2/$ipDNS2/g" "$setupCompleteFile"
|
sed -ri "s/ipDNS2/$ipDNS2/g" "$setupCompleteFile"
|
||||||
else
|
else
|
||||||
sed -ri "s/setmode=on/setmode=off/g" "$setupCompleteFile"
|
sed -ri "s/setipv4mode=on/setipv4mode=off/g" "$setupCompleteFile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Write IPv6 static config script to setup step.
|
||||||
|
if [[ "$Network6Config" == "isStatic" && -n "$ip6Addr" && -n "$actualIp6Prefix" && -n "$ip6Gate" ]]; then
|
||||||
|
sed -ri "s/ip6Addr/$ip6Addr/g" "$setupCompleteFile"
|
||||||
|
sed -ri "s/actualIp6Prefix/$actualIp6Prefix/g" "$setupCompleteFile"
|
||||||
|
sed -ri "s/ip6Gate/$ip6Gate/g" "$setupCompleteFile"
|
||||||
|
sed -ri "s/ip6DNS1/$ip6DNS1/g" "$setupCompleteFile"
|
||||||
|
sed -ri "s/ip6DNS2/$ip6DNS2/g" "$setupCompleteFile"
|
||||||
|
else
|
||||||
|
sed -ri "s/setipv6mode=on/setipv6mode=off/g" "$setupCompleteFile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Umount mounted directory and loop device.
|
# Umount mounted directory and loop device.
|
||||||
|
|
Loading…
Add table
Reference in a new issue