tinyssh 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +0 -3
- data/bin/tinyssh +9 -4
- data/lib/tinyssh.rb +2 -2
- metadata +4 -4
data/README.md
CHANGED
@@ -17,9 +17,6 @@ gem install net-ssh
|
|
17
17
|
gem install net-scp
|
18
18
|
gem install highline
|
19
19
|
gem install tinyssh
|
20
|
-
|
21
|
-
find / -name tinyssh # find where tinyssh installed
|
22
|
-
ln -sv location_of_tinyssh /usr/local/bin # if you use rvm to manage multi version ruby, you don't need do this
|
23
20
|
```
|
24
21
|
|
25
22
|
## Usage
|
data/bin/tinyssh
CHANGED
@@ -7,9 +7,9 @@ require 'highline/import'
|
|
7
7
|
require 'net/ssh'
|
8
8
|
require 'net/scp'
|
9
9
|
|
10
|
-
require 'colorize'
|
11
|
-
require 'tinysshoptparse'
|
12
|
-
require 'tinyssh'
|
10
|
+
require 'lib/colorize'
|
11
|
+
require 'lib/tinysshoptparse'
|
12
|
+
require 'lib/tinyssh'
|
13
13
|
|
14
14
|
T = []
|
15
15
|
HOST = []
|
@@ -35,7 +35,12 @@ def main(options)
|
|
35
35
|
|
36
36
|
HOST.each_with_index do |host, index|
|
37
37
|
T << Thread.new {
|
38
|
-
session = Net::SSH.conn(host, options.user,
|
38
|
+
session = Net::SSH.conn(host, options.user,
|
39
|
+
:port => options.port,
|
40
|
+
:password => password,
|
41
|
+
:keys => options.keys,
|
42
|
+
:timeout => options.timeout,
|
43
|
+
:passphrase => passphrase.chomp)
|
39
44
|
|
40
45
|
if session.class == String
|
41
46
|
OUTPUT[index] = session % host
|
data/lib/tinyssh.rb
CHANGED
@@ -8,7 +8,6 @@ include Net::SSH
|
|
8
8
|
module Net::SSH
|
9
9
|
def conn(*options)
|
10
10
|
begin
|
11
|
-
puts 'try to connction'
|
12
11
|
return Net::SSH.start(*options)
|
13
12
|
rescue Timeout::Error
|
14
13
|
return "\n#{OUTPUT_TITLE}\nHost : %s [ " + "Connecting Timeout".red + " ] !\n"
|
@@ -18,7 +17,8 @@ module Net::SSH
|
|
18
17
|
return "\n#{OUTPUT_TITLE}\nHost : %s [ " + "Connection Refused".red + " ] !\n"
|
19
18
|
rescue Net::SSH::AuthenticationFailed
|
20
19
|
return "\n#{OUTPUT_TITLE}\nHost : %s [ " + "Authentication Failure".red + " ] !\n"
|
21
|
-
rescue
|
20
|
+
rescue => e
|
21
|
+
puts e
|
22
22
|
return "\n#{OUTPUT_TITLE}\nHost : %s [ " + "Name or Server not know".red + " ] !\n"
|
23
23
|
end
|
24
24
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tinyssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- William Herry
|
@@ -34,7 +34,7 @@ files:
|
|
34
34
|
- Rakefile
|
35
35
|
- test/test_tinyssh.rb
|
36
36
|
- bin/tinyssh
|
37
|
-
homepage: https://
|
37
|
+
homepage: https://github.com/williamherry/tinyssh
|
38
38
|
licenses: []
|
39
39
|
|
40
40
|
post_install_message:
|