Merge pull request #5558 from legal90/fix-darwin-hostname
Fixed error in ChangeHostName capability for Darwin
This commit is contained in:
commit
7dd7e1718e
|
@ -6,7 +6,9 @@ module VagrantPlugins
|
|||
if !machine.communicate.test("hostname -f | grep '^#{name}$' || hostname -s | grep '^#{name}$'")
|
||||
machine.communicate.sudo("scutil --set ComputerName #{name}")
|
||||
machine.communicate.sudo("scutil --set HostName #{name}")
|
||||
machine.communicate.sudo("scutil --set LocalHostName #{name}")
|
||||
# LocalHostName shouldn't contain dots.
|
||||
# It is used by Bonjour and visible through file sharing services.
|
||||
machine.communicate.sudo("scutil --set LocalHostName #{name.gsub(/\.+/, '')}")
|
||||
machine.communicate.sudo("hostname #{name}")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue