Merge pull request #1023 from bobmaerten/change-host-name

change_host_name should change mailname too
This commit is contained in:
Mitchell Hashimoto 2012-07-14 16:30:01 -07:00
commit 45c4248d09
2 changed files with 2 additions and 0 deletions

View File

@ -62,6 +62,7 @@ module VagrantPlugins
vm.channel.sudo("sed -r -i 's/^(127[.]0[.]1[.]1[[:space:]]+).*$/\\1#{name} #{name.split('.')[0]}/' /etc/hosts")
vm.channel.sudo("sed -i 's/.*$/#{name.split('.')[0]}/' /etc/hostname")
vm.channel.sudo("hostname -F /etc/hostname")
vm.channel.sudo("hostname --fqdn > /etc/mailname")
end
end
end

View File

@ -18,6 +18,7 @@ module VagrantPlugins
vm.channel.sudo("sed -i 's/.*$/#{name}/' /etc/hostname")
vm.channel.sudo("sed -i 's@^\\(127[.]0[.]1[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
vm.channel.sudo("service hostname start")
vm.channel.sudo("hostname --fqdn > /etc/mailname")
end
end
end