fix typo in change_host_name

This commit is contained in:
Benedikt Böhm 2012-05-14 17:16:41 +02:00
parent d3686465db
commit 46d72bb53a
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ module VagrantPlugins
def change_host_name(name) def change_host_name(name)
if !vm.channel.test("sudo hostname --fqdn | grep '#{name}'") if !vm.channel.test("sudo hostname --fqdn | grep '#{name}'")
vm.channel.sudo("echo 'hostname=#{name.split('.')[0]}' > /etc/conf.d/hostname") vm.channel.sudo("echo 'hostname=#{name.split('.')[0]}' > /etc/conf.d/hostname")
vm.channel.sudo("sed -i 's@^\\(127[.]0[.]1[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts") vm.channel.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
vm.channel.sudo("hostname #{name.split('.')[0]}") vm.channel.sudo("hostname #{name.split('.')[0]}")
end end
end end