class SSHCommand
Executes commands in a remote machine ussing ssh. See documentation for GenericCommand
Attributes
Public Class Methods
Source
# File lib/CommandManager.rb, line 226 def initialize(command, host, logger=nil, stdin=nil, timeout=nil) @host=host super(command, logger, stdin, timeout) end
This one takes another parameter. host
is the machine where the command is going to be executed
Calls superclass method
GenericCommand::new
Source
# File lib/CommandManager.rb, line 218 def self.run(command, host, logger=nil, stdin=nil, timeout=nil) cmd=self.new(command, host, logger, stdin, timeout) cmd.run cmd end
Creates a command and runs it
Private Instance Methods
Source
# File lib/CommandManager.rb, line 233 def execute if @stdin capture3_timeout("ssh #{@host} #{@command}", :pgroup => true, :stdin_data => @stdin) else capture3_timeout("ssh -n #{@host} #{@command}", :pgroup => true) end end