FreeBSD: Use quotes around hostname in rc.conf
Use double quotes around the hostname value in /etc/rc.conf
This commit is contained in:
parent
54aa2f640a
commit
0844b49c7a
|
@ -4,7 +4,7 @@ module VagrantPlugins
|
|||
class ChangeHostName
|
||||
def self.change_host_name(machine, name)
|
||||
if !machine.communicate.test("hostname -f | grep '^#{name}$' || hostname -s | grep '^#{name}$'", {shell: "sh"})
|
||||
machine.communicate.sudo("sed -i '' 's/^hostname=.*$/hostname=#{name}/' /etc/rc.conf", {shell: "sh"})
|
||||
machine.communicate.sudo("sed -i '' 's/^hostname=.*$/hostname=\"#{name}\"/' /etc/rc.conf", {shell: "sh"})
|
||||
machine.communicate.sudo("hostname #{name}", {shell: "sh"})
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue