landrush 1.1.0.beta.3 → 1.1.0.beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/landrush/cap/host/windows/configure_visibility_on_host.rb +23 -25
- data/lib/landrush/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f14705abc9cca46ab6289380605e920f7d0b1b9
|
4
|
+
data.tar.gz: 9fec7c2e50cb5d6e5e006474320894bca04df10e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a6d04db3fbe1e996d3f71cf650793c6876436ad851d062428fc563ee8218de1f5ba3771611ecafc1d55b3c56bee2a64a0eacdace3581ae23ebbeb4b87b36dda
|
7
|
+
data.tar.gz: 43738660461e9f0b5c20aa7d43e46063ef5cadacc406799daeb927679666bdeb3cf806d5d5f18f5973a17eadef759390a87790ed184d626b40a214a7efa0f05f
|
@@ -54,24 +54,26 @@ module Landrush
|
|
54
54
|
def update_network_adapter(ip, tld)
|
55
55
|
# Need to defer loading to ensure cross OS compatibility
|
56
56
|
require 'win32/registry'
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
57
|
+
if admin_mode?
|
58
|
+
network_name = get_network_name(ip)
|
59
|
+
if network_name.nil?
|
60
|
+
info("unable to determine network interface for #{ip}. DNS on host cannot be configured. Try manual configuration.")
|
61
|
+
return
|
62
|
+
else
|
63
|
+
info("adding Landrush'es DNS server to network '#{network_name}' using DNS IP '#{ip}'' and search domain '#{tld}'")
|
64
|
+
end
|
65
|
+
network_guid = get_guid(network_name)
|
66
|
+
if network_guid.nil?
|
67
|
+
info("unable to determine network GUID for #{ip}. DNS on host cannot be configured. Try manual configuration.")
|
68
|
+
return
|
69
|
+
end
|
70
|
+
interface_path = INTERFACES + "\\{#{network_guid}}"
|
71
|
+
Win32::Registry::HKEY_LOCAL_MACHINE.open(interface_path, Win32::Registry::KEY_ALL_ACCESS) do |reg|
|
72
|
+
reg['NameServer'] = '127.0.0.1'
|
73
|
+
reg['Domain'] = tld
|
74
|
+
end
|
63
75
|
else
|
64
|
-
|
65
|
-
end
|
66
|
-
network_guid = get_guid(network_name)
|
67
|
-
if network_guid.nil?
|
68
|
-
info("unable to determine network GUID for #{ip}. DNS on host cannot be configured. Try manual configuration.")
|
69
|
-
return
|
70
|
-
end
|
71
|
-
interface_path = INTERFACES + "\\{#{network_guid}}"
|
72
|
-
Win32::Registry::HKEY_LOCAL_MACHINE.open(interface_path, Win32::Registry::KEY_ALL_ACCESS) do |reg|
|
73
|
-
reg['NameServer'] = '127.0.0.1'
|
74
|
-
reg['Domain'] = tld
|
76
|
+
run_with_admin_privileges(__FILE__.to_s, ip, tld)
|
75
77
|
end
|
76
78
|
end
|
77
79
|
|
@@ -133,14 +135,10 @@ module Landrush
|
|
133
135
|
|
134
136
|
# Makes sure that we have admin privileges and if nor starts a new shell with the required
|
135
137
|
# privileges
|
136
|
-
def
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
shell.ShellExecute('ruby', "#{file} #{args.join(' ')}", nil, 'runas', 1)
|
141
|
-
# need to exit current execution, changes will occur in new environment
|
142
|
-
exit
|
143
|
-
end
|
138
|
+
def run_with_admin_privileges(file, *args)
|
139
|
+
require 'win32ole'
|
140
|
+
shell = WIN32OLE.new('Shell.Application')
|
141
|
+
shell.ShellExecute('ruby', "#{file} #{args.join(' ')}", nil, 'runas', 1)
|
144
142
|
end
|
145
143
|
|
146
144
|
def info(msg)
|
data/lib/landrush/version.rb
CHANGED