Fix hostname setting also in Debian, part N

Port #2384 / #2383 for Debian guests.
This commit is contained in:
Teemu Matilainen 2013-10-31 21:39:45 -03:00
parent a92e03cf4c
commit 2073a1a939
1 changed files with 1 additions and 2 deletions

View File

@ -22,8 +22,7 @@ module VagrantPlugins
# hosts should resemble:
# 127.0.0.1 localhost host.fqdn.com host
# 127.0.1.1 host.fqdn.com host
# First to set fqdn
comm.sudo("sed -ri 's@^(([0-9]{1,3}\.){3}[0-9]{1,3})\\s+(localhost)\\b.*$@\\1\\t#{name} #{name.split('.')[0]} \\3@g' /etc/hosts")
comm.sudo("sed -ri 's@^(([0-9]{1,3}\.){3}[0-9]{1,3})\\s+(localhost)\\b.*$@\\1\\t\\3 #{name} #{name.split('.')[0]}@g' /etc/hosts")
comm.sudo("sed -ri 's@^(([0-9]{1,3}\.){3}[0-9]{1,3})\\s+(#{old.split('.')[0]})\\b.*$@\\1\\t#{name} #{name.split('.')[0]}@g' /etc/hosts")
comm.sudo("hostname -F /etc/hostname")