From 06aaa6e6eaf5c296feee1d334ff9bffe2c90e4d2 Mon Sep 17 00:00:00 2001 From: Elliot Segler Date: Tue, 8 Oct 2013 17:53:27 +0800 Subject: [PATCH] #2333, more fixes - right order to get fqdn right --- plugins/guests/ubuntu/cap/change_host_name.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/guests/ubuntu/cap/change_host_name.rb b/plugins/guests/ubuntu/cap/change_host_name.rb index 5c4190a11..be4818086 100644 --- a/plugins/guests/ubuntu/cap/change_host_name.rb +++ b/plugins/guests/ubuntu/cap/change_host_name.rb @@ -22,7 +22,7 @@ module VagrantPlugins # hosts should resemble: # 127.0.0.1 localhost host.fqdn.com host # 127.0.1.1 host.fqdn.com host - comm.sudo("sed -ri 's@^((\\b[0-9]{1,3}\.){3}[0-9]{1,3})\\b.*(localhost).*$@\\1\\t\\3 #{name} #{name.split('.')[0]}@g' /etc/hosts") + comm.sudo("sed -ri 's@^((\\b[0-9]{1,3}\.){3}[0-9]{1,3})\\b.*(localhost).*$@\\1\\t#{name} #{name.split('.')[0]} \\3@g' /etc/hosts") comm.sudo("sed -ri 's@^((\\b[0-9]{1,3}\.){3}[0-9]{1,3})\\b.*(precise64).*$@\\1\\t#{name} #{name.split('.')[0]}@g' /etc/hosts") if comm.test("[ `lsb_release -c -s` = hardy ]")