From 2073a1a9390deedcb6bb6dc2efc0c52999056605 Mon Sep 17 00:00:00 2001 From: Teemu Matilainen Date: Thu, 31 Oct 2013 21:39:45 -0300 Subject: [PATCH] Fix hostname setting also in Debian, part N Port #2384 / #2383 for Debian guests. --- plugins/guests/debian/cap/change_host_name.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/guests/debian/cap/change_host_name.rb b/plugins/guests/debian/cap/change_host_name.rb index 118592c27..d75d45d50 100644 --- a/plugins/guests/debian/cap/change_host_name.rb +++ b/plugins/guests/debian/cap/change_host_name.rb @@ -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")