Whitespace
This commit is contained in:
parent
192c8f59e9
commit
cd36088d2f
|
@ -10,14 +10,14 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
def change_host_name(name)
|
def change_host_name(name)
|
||||||
vm.communicate.tap do |comm|
|
vm.communicate.tap do |comm|
|
||||||
# Only do this if the hostname is not already set
|
# Only do this if the hostname is not already set
|
||||||
if !comm.test("sudo hostname | grep '#{name}'")
|
if !comm.test("sudo hostname | grep '#{name}'")
|
||||||
comm.sudo("echo '#{name}' > /etc/HOSTNAME")
|
comm.sudo("echo '#{name}' > /etc/HOSTNAME")
|
||||||
comm.sudo("hostname #{name}")
|
comm.sudo("hostname #{name}")
|
||||||
comm.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
|
comm.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue