Module: ZTK::SSH::Console

Included in:
ZTK::SSH
Defined in:
lib/ztk/ssh/console.rb

Overview

SSH Console Functionality

Instance Method Summary (collapse)

Instance Method Details

- (Object) console(*arguments)

Launches an SSH console, replacing the current process with the console process.

Examples:

Launch a console:

ssh = ZTK::SSH.new
ssh.config do |config|
  config.user = ENV["USER"]
  config.host_name = "127.0.0.1"
end
ssh.console


17
18
19
20
21
22
23
24
25
26
# File 'lib/ztk/ssh/console.rb', line 17

def console(*arguments)
  command = [console_command, *arguments].flatten.compact.join(' ')

  config.ui.logger.debug { "config=#{config.send(:table).inspect}" }
  config.ui.logger.info { "console(#{command.inspect})" }

  config.ui.logger.fatal { "REPLACING CURRENT PROCESS - GOODBYE!" }

  Kernel.exec(command)
end