From 903578269bec30ba1c83a0bf2cb53a2067b67676 Mon Sep 17 00:00:00 2001 From: Boohbah Date: Sat, 10 Aug 2013 00:41:18 +0000 Subject: [PATCH] Use hostnamectl in plugins/guests/arch/cap/change_host_name.rb --- plugins/guests/arch/cap/change_host_name.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/guests/arch/cap/change_host_name.rb b/plugins/guests/arch/cap/change_host_name.rb index a32da048e..be0fd3079 100644 --- a/plugins/guests/arch/cap/change_host_name.rb +++ b/plugins/guests/arch/cap/change_host_name.rb @@ -6,8 +6,7 @@ module VagrantPlugins machine.communicate.tap do |comm| # Only do this if the hostname is not already set if !comm.test("sudo hostname | grep '#{name}'") - comm.sudo("sed -i 's/\\(HOSTNAME=\\).*/\\1#{name}/' /etc/rc.conf") - comm.sudo("hostname #{name}") + comm.sudo("hostnamectl set-hostname #{name}") comm.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} @' /etc/hosts") end end