lib/ssh/manager/cli.rb in ssh-manager-1.1.0 vs lib/ssh/manager/cli.rb in ssh-manager-1.1.1

- old
+ new

@@ -24,10 +24,18 @@ @visible_fields = [:id, :ip, :group, :note] @input_fields = [:ip, :hostname, :user, :port, :options, :note, :group, :connect_via] @column_width = 15 #TODO make this dynamic or a yaml setting end + def check_connection_type(connection) + if connection.class == String + "hostname" + else + "ip" + end + end + def connect_to(id) id.each do |conn| conn.to_i ssh_command = "" i = conn @@ -112,13 +120,10 @@ exec("#{ssh} ping #{connection[:ip]} -c 3") else exec("ping #{connection[:ip]} -c 3") end end - - def test(type) - require 'byebug' - byebug + def test(id) end def transfer_file(filename, id='', dest_path="/home/#{user}/") #TODO connect_via #TODO options