Fixing fix-second-network.ps1
This commit is contained in:
2
Vagrant/Vagrantfile
vendored
2
Vagrant/Vagrantfile
vendored
@@ -188,7 +188,7 @@ Vagrant.configure("2") do |config|
|
|||||||
cfg.winrm.retry_limit = 20
|
cfg.winrm.retry_limit = 20
|
||||||
cfg.vm.network :private_network, ip: "192.168.38.104", gateway: "192.168.38.1", dns: "192.168.38.102"
|
cfg.vm.network :private_network, ip: "192.168.38.104", gateway: "192.168.38.1", dns: "192.168.38.102"
|
||||||
|
|
||||||
cfg.vm.provision "shell", path: "scripts/fix-second-network.ps1", privileged: true, args: "-ip 192.168.38.104 -dns 8.8.8.8 -gateway 192.168.38.1"
|
cfg.vm.provision "shell", path: "scripts/fix-second-network.ps1", privileged: false, args: "-ip 192.168.38.104 -dns 8.8.8.8 -gateway 192.168.38.1"
|
||||||
cfg.vm.provision "shell", path: "scripts/MakeWindows10GreatAgain.ps1", privileged: false
|
cfg.vm.provision "shell", path: "scripts/MakeWindows10GreatAgain.ps1", privileged: false
|
||||||
cfg.vm.provision "shell", path: "scripts/provision.ps1", privileged: false
|
cfg.vm.provision "shell", path: "scripts/provision.ps1", privileged: false
|
||||||
cfg.vm.provision "reload"
|
cfg.vm.provision "reload"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# Source: https://github.com/StefanScherer/adfs2
|
# Source: https://github.com/StefanScherer/adfs2
|
||||||
param ([String] $ip, [String] $dns, [String] $gateway)
|
param ([String] $ip, [String] $dns, [String] $gateway)
|
||||||
|
|
||||||
|
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Running fix-second-network.ps1..."
|
||||||
|
|
||||||
if ( (Get-NetAdapter | Select-Object -First 1 | Select-Object -ExpandProperty InterfaceDescription).Contains('Red Hat VirtIO')) {
|
if ( (Get-NetAdapter | Select-Object -First 1 | Select-Object -ExpandProperty InterfaceDescription).Contains('Red Hat VirtIO')) {
|
||||||
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Setting Network Configuration for LibVirt interface"
|
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Setting Network Configuration for LibVirt interface"
|
||||||
$subnet = $ip -replace "\.\d+$", ""
|
$subnet = $ip -replace "\.\d+$", ""
|
||||||
@@ -18,10 +20,12 @@ if ( (Get-NetAdapter | Select-Object -First 1 | Select-Object -ExpandProperty In
|
|||||||
Write-Error "Could not find a interface with subnet $subnet.xx"
|
Write-Error "Could not find a interface with subnet $subnet.xx"
|
||||||
}
|
}
|
||||||
exit 0
|
exit 0
|
||||||
|
} Else {
|
||||||
|
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) No VirtIO adapters, moving on..."
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! (Test-Path 'C:\Program Files\VMware\VMware Tools') ) {
|
if (! (Test-Path 'C:\Program Files\VMware\VMware Tools') ) {
|
||||||
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Nothing to do for other providers than VMware."
|
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) VMware Tools not found, no need to continue. Exiting."
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user