From 535eb35206948027b6205b80c84fa0fbfa56d9c1 Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Tue, 15 Oct 2013 15:57:15 -0300 Subject: [PATCH] Use old name instead of hard coded 'precise64' --- 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 b8860d592..bd302ad6f 100644 --- a/plugins/guests/ubuntu/cap/change_host_name.rb +++ b/plugins/guests/ubuntu/cap/change_host_name.rb @@ -23,7 +23,7 @@ module VagrantPlugins # 127.0.0.1 localhost host.fqdn.com host # 127.0.1.1 host.fqdn.com host 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+(precise64)\\b.*$@\\1\\t#{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") if comm.test("[ `lsb_release -c -s` = hardy ]") # hostname.sh returns 1, so I grep for the right name in /etc/hostname just to have a 0 exitcode