ssh-manager 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ssh/manager/cli.rb +18 -9
- data/lib/ssh/manager/client.rb +0 -1
- data/lib/ssh/manager/db.rb +2 -2
- data/lib/ssh/manager/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 242c3e31b394c8af8a1e562047d81bf97e80230a
|
4
|
+
data.tar.gz: cdf870f02298851e998e8b3b0356689a842b23e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 279cd4ac17a71b57d32348e2269d873e69b55ef29d98ab36f07716c07bda85cf5128e49231475fc2cb3fbf88f52fbaaf52f6163758c5505189732f6488b9d8bd
|
7
|
+
data.tar.gz: ca26cc043b4757ca6d15ad9a693b08e8088eb3ff59d16b9d85e1755e09c8720d4a1629de6500c20126a8f49c23306ce64b6b5b81a5ce8a50b60baac6ca17d73c
|
data/lib/ssh/manager/cli.rb
CHANGED
@@ -34,9 +34,17 @@ module SSH
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def connect_to(id)
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
via = DATABASE.get_connection_data[id.to_i-1][-1] =~ /@/
|
38
|
+
if via.integer? == false
|
39
|
+
@ip = DATABASE.get_connection_data[id.to_i-1][0]
|
40
|
+
@user = DATABASE.get_connection_data[id.to_i-1][1]
|
41
|
+
check_term(@ip, @user)
|
42
|
+
else
|
43
|
+
@ip = DATABASE.get_connection_data[id.to_i-1][0]
|
44
|
+
@user = DATABASE.get_connection_data[id.to_i-1][1]
|
45
|
+
via = DATABASE.get_connection_data[id.to_i-1][-1]
|
46
|
+
%x(gnome-terminal --command="ssh -A -t #{via} ssh -A -t #{@user}@#{@ip}")
|
47
|
+
end
|
40
48
|
#TODO: check for options
|
41
49
|
#TODO: if db[secure_login] = false => http://linuxcommando.blogspot.de/2008/10/how-to-disable-ssh-host-key-checking.html
|
42
50
|
end
|
@@ -80,15 +88,16 @@ module SSH
|
|
80
88
|
options = '' if options == ''
|
81
89
|
puts 'Group: '
|
82
90
|
group = $stdin.gets.chomp
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
91
|
+
puts 'Connect via(ip): '
|
92
|
+
connect_via_ip = $stdin.gets.chomp
|
93
|
+
puts 'With Username: '
|
94
|
+
connect_via_user = $stdin.gets.chomp
|
95
|
+
connect_via= "#{connect_via_user}@#{connect_via_ip}"
|
96
|
+
# ssh -A -t jxs@10.160.64.184 ssh -A -t tux@10.160.65.2
|
88
97
|
count = 0
|
89
98
|
created_at = Time.now.to_s
|
90
99
|
last_time = Time.now.to_s
|
91
|
-
DATABASE.add_new_connection(ip, user, hostname, port, note, created_at, options, count, group, last_time)
|
100
|
+
DATABASE.add_new_connection(ip, user, hostname, port, note, connect_via, created_at, options, count, group, last_time)
|
92
101
|
end
|
93
102
|
|
94
103
|
def delete(id)
|
data/lib/ssh/manager/client.rb
CHANGED
data/lib/ssh/manager/db.rb
CHANGED
@@ -21,8 +21,8 @@ module SSH
|
|
21
21
|
@connections.map([:ip, :user, :note, :group, :connect_via])
|
22
22
|
end
|
23
23
|
|
24
|
-
def add_new_connection(ip, user='root', hostname='', port=22, note='', created_at, option, count, group, last_time)
|
25
|
-
@connections.insert(:ip => ip, :user => user, :hostname => hostname, :port => port, :note => note, :created_at => created_at, :options => option, :group => group, :count => count, :last_time => last_time)
|
24
|
+
def add_new_connection(ip, user='root', hostname='', port=22, note='', connect_via='', created_at, option, count, group, last_time)
|
25
|
+
@connections.insert(:ip => ip, :user => user, :hostname => hostname, :port => port, :note => note, :connect_via => connect_via, :created_at => created_at, :options => option, :group => group, :count => count, :last_time => last_time)
|
26
26
|
end
|
27
27
|
|
28
28
|
def delete_connection(ip)
|
data/lib/ssh/manager/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ssh-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Schmid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -127,3 +127,4 @@ summary: manage and connect ssh
|
|
127
127
|
test_files:
|
128
128
|
- spec/client_spec.rb
|
129
129
|
- spec/spec_helper.rb
|
130
|
+
has_rdoc:
|