Merge pull request #1023 from bobmaerten/change-host-name
change_host_name should change mailname too
This commit is contained in:
commit
45c4248d09
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue