lib/ztk/ssh.rb in ztk-0.0.12 vs lib/ztk/ssh.rb in ztk-0.0.14
- old
+ new
@@ -121,14 +121,13 @@
# Primarily used internally.
def sftp
@sftp ||= Net::SFTP.start(@config.host_name, @config.user, ssh_options)
end
- # Close our sessions gracefully.
+ # Close our session gracefully.
def close
log(:debug) { "close" }
- ssh and ssh.close
- sftp and sftp.close
+ ssh and !ssh.closed? and ssh.close
end
# Launches an SSH console, replacing the current process with the console
# process.
#