I'm new to Ruby, so please forgive me if I missed something obvious.
The problem is that Ruby doesn't seem to do the interpolation variable in Net :: SSH.exec! Method.
VCL_DIR = "/usr/local/etc/varnish/"
host = '0.0.0.0'
Net::SSH.start(host, 'root') do |ssh|
puts "Changing directories to #{VCL_DIR}"
ssh.exec!("cd #{VCL_DIR}")
res = ssh.exec!("pwd")
puts "Server reports current directory as #{res}"
end
Conclusion:
Changing directories to /usr/local/etc/varnish/
Server reports current directory as /root
Any help is appreciated. Using Ruby 1.9.3p194
source
share