From ea9b28f9b6239176dfc4a472355dee9ef5638dab Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Wed, 22 Jun 2016 18:33:39 -0700 Subject: [PATCH] guests/freebsd: Check FQDN for hostname --- plugins/guests/freebsd/cap/change_host_name.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/guests/freebsd/cap/change_host_name.rb b/plugins/guests/freebsd/cap/change_host_name.rb index fc194d6d9..09b517e9b 100644 --- a/plugins/guests/freebsd/cap/change_host_name.rb +++ b/plugins/guests/freebsd/cap/change_host_name.rb @@ -6,7 +6,7 @@ module VagrantPlugins options = { shell: "sh" } comm = machine.communicate - if !comm.test("hostname -f | grep -w '#{name}' || hostname -s | grep -w '#{name}'", options) + if !comm.test("hostname -f | grep '^#{name}$'", options) basename = name.split(".", 2)[0] command = <<-EOH.gsub(/^ {14}/, '') # Set the hostname