Replace `test?` call with proper `test` call

This commit is contained in:
Mitchell Hashimoto 2012-01-17 14:43:32 -08:00
parent 06733a070d
commit d675b7c83c
1 changed files with 1 additions and 1 deletions

View File

@ -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")