lib/ztk/ssh/command.rb
# Builds our SSH console command.
Builds our SSH console command.
Builds our SSH console command .
def console_command
        process_keys
        verbosity = ((ENV['LOG_LEVEL'] == "DEBUG") ? '-vv' : '-q')
        command = Array.new
        command << [ %(ssh) ]
        command << [ verbosity ]
        command << [ "-x" ]
        command << [ "-a" ]
        command << [ "-o", "UserKnownHostsFile=/dev/null" ]
        command << [ "-o", "StrictHostKeyChecking=no" ]
        command << [ "-o", "KeepAlive=yes" ]
        command << [ "-o", "ServerAliveInterval=60" ]
        command << [ "-o", %(ProxyCommand="#{proxy_command}") ] if config.proxy_host_name
        !config.keys.nil? and !config.keys.empty? and [config.keys].flatten.compact.each do |key|
          command << [ "-i", key ]
        end
        command << [ "-p", config.port ] if config.port
        command << "#{config.user}@#{config.host_name}"
        command = command.flatten.compact.join(' ')
        config.ui.logger.debug { "console_command(#{command.inspect})" }
        command
      end
def console_command process_keys verbosity = ( ( ENV [ 'LOG_LEVEL' ] == "DEBUG" ) ? '-vv' : '-q' ) command = Array . new command << [ %(ssh) ] command << [ verbosity ] command << [ "-x" ] command << [ "-a" ] command << [ "-o" , "UserKnownHostsFile=/dev/null" ] command << [ "-o" , "StrictHostKeyChecking=no" ] command << [ "-o" , "KeepAlive=yes" ] command << [ "-o" , "ServerAliveInterval=60" ] command << [ "-o" , %(ProxyCommand="#{proxy_command}") ] if config . proxy_host_name ! config . keys . nil? and ! config . keys . empty? and [ config . keys ] . flatten . compact . each do | key | command << [ "-i" , key ] end command << [ "-p" , config . port ] if config . port command << "#{config.user}@#{config.host_name}" command = command . flatten . compact . join ( ' ' ) config . ui . logger . debug { "console_command(#{command.inspect})" } command end
Builds our SSH console command.
Builds our SSH console command .
# command << [ %(sshpass -p '#{config.password}') ] if config.password