Add "short" hostname to "/etc/hosts" mimicking Debian behaviour. [closes GH-456]
This commit is contained in:
parent
6428d7fa2f
commit
1ec225e052
|
@ -39,7 +39,7 @@ module Vagrant
|
|||
if !ssh.test?("sudo hostname | grep '#{name}'")
|
||||
ssh.exec!("sudo sed -i 's/\\(HOSTNAME=\\).*/\\1#{name}/' /etc/sysconfig/network")
|
||||
ssh.exec!("sudo hostname #{name}")
|
||||
ssh.exec!("sudo sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} @' /etc/hosts")
|
||||
ssh.exec!("sudo sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue