Replace `test?` call with proper `test` call
This commit is contained in:
parent
06733a070d
commit
d675b7c83c
|
@ -50,7 +50,7 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
def change_host_name(name)
|
def change_host_name(name)
|
||||||
if !vm.channel.test?("hostname --fqdn | grep '^#{name}$' || hostname --short | grep '^#{name}$'")
|
if !vm.channel.test("hostname --fqdn | grep '^#{name}$' || hostname --short | grep '^#{name}$'")
|
||||||
vm.channel.sudo("sed -r -i 's/^(127[.]0[.]1[.]1[[:space:]]+).*$/\\1#{name} #{name.split('.')[0]}/' /etc/hosts")
|
vm.channel.sudo("sed -r -i 's/^(127[.]0[.]1[.]1[[:space:]]+).*$/\\1#{name} #{name.split('.')[0]}/' /etc/hosts")
|
||||||
vm.channel.sudo("sed -i 's/.*$/#{name.split('.')[0]}/' /etc/hostname")
|
vm.channel.sudo("sed -i 's/.*$/#{name.split('.')[0]}/' /etc/hostname")
|
||||||
vm.channel.sudo("hostname -F /etc/hostname")
|
vm.channel.sudo("hostname -F /etc/hostname")
|
||||||
|
|
Loading…
Reference in New Issue