From b281681b11cb2a3a8d734943b0251ff03e93d944 Mon Sep 17 00:00:00 2001 From: Chris Liles Date: Tue, 1 Oct 2013 13:17:18 -0700 Subject: [PATCH] adding solairs support --- lib/vagrant-hostmanager/hosts_file.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-hostmanager/hosts_file.rb b/lib/vagrant-hostmanager/hosts_file.rb index bc3c753..f367c04 100644 --- a/lib/vagrant-hostmanager/hosts_file.rb +++ b/lib/vagrant-hostmanager/hosts_file.rb @@ -6,14 +6,20 @@ module VagrantPlugins def update_guest(machine) return unless machine.communicate.ready? + if (machine.communicate.test("uname -s | grep SunOS")) + realhostfile = '/etc/inet/hosts' + else + realhostfile = '/etc/hosts' + end + # download and modify file with Vagrant-managed entries file = @global_env.tmp_path.join("hosts.#{machine.name}") - machine.communicate.download('/etc/hosts', file) + machine.communicate.download(realhostfile, file) update_file(file) # upload modified file and remove temporary file machine.communicate.upload(file, '/tmp/hosts') - machine.communicate.sudo('mv /tmp/hosts /etc/hosts') + machine.communicate.sudo("mv /tmp/hosts #{realhostfile}") # i have no idea if this is a windows competibility issue or not, but sometimes it dosen't work on my machine begin FileUtils.rm(file)