Merge pull request #2267 from fcharlier/fcharlier/dhcp_hostname_redhat
guests/redhat: Allow to change the DHCP_HOSTNAME on RedHat
This commit is contained in:
commit
0d739035b5
|
@ -9,6 +9,8 @@ module VagrantPlugins
|
|||
comm.sudo("sed -i 's/\\(HOSTNAME=\\).*/\\1#{name}/' /etc/sysconfig/network")
|
||||
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/\\(DHCP_HOSTNAME=\\).*/\\1\"#{name}\"/' /etc/sysconfig/network-scripts/ifcfg-*")
|
||||
comm.sudo("service network restart")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue