tinyssh 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/tinyssh +3 -4
- data/lib/tinyssh.rb +7 -0
- data/lib/tinysshoptparse.rb +5 -1
- metadata +3 -3
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 '
|
11
|
-
require '
|
12
|
-
require '
|
10
|
+
require 'colorize'
|
11
|
+
require 'tinysshoptparse'
|
12
|
+
require 'tinyssh'
|
13
13
|
|
14
14
|
T = []
|
15
15
|
HOST = []
|
@@ -26,7 +26,6 @@ def main(options)
|
|
26
26
|
end
|
27
27
|
else
|
28
28
|
TinysshOptparse.parse(['-h'])
|
29
|
-
puts 'ss'
|
30
29
|
exit
|
31
30
|
end
|
32
31
|
|
data/lib/tinyssh.rb
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'net/ssh'
|
3
|
+
|
4
|
+
OUTPUT_TITLE = "-------------------------- EXECUTE STATUS --------------------------"
|
5
|
+
|
1
6
|
include Net::SSH
|
2
7
|
|
3
8
|
module Net::SSH
|
@@ -12,6 +17,8 @@ module Net::SSH
|
|
12
17
|
return "\n#{OUTPUT_TITLE}\nHost : %s [ " + "Connection Refused".red + " ] !\n"
|
13
18
|
rescue Net::SSH::AuthenticationFailed
|
14
19
|
return "\n#{OUTPUT_TITLE}\nHost : %s [ " + "Authentication Failure".red + " ] !\n"
|
20
|
+
else
|
21
|
+
return "\n#{OUTPUT_TITLE}\nHost : %s [ " + "Name or Server not know".red + " ] !\n"
|
15
22
|
end
|
16
23
|
end
|
17
24
|
end
|
data/lib/tinysshoptparse.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
+
require 'optparse'
|
2
|
+
require 'ostruct'
|
3
|
+
|
1
4
|
class TinysshOptparse
|
2
5
|
def self.parse(args)
|
3
6
|
options = OpenStruct.new
|
4
7
|
options.user = 'root'
|
5
|
-
options.port = '
|
8
|
+
options.port = '22'
|
6
9
|
options.num = '0'
|
7
10
|
options.keys = ['/root/.ssh/id_rsa']
|
8
11
|
options.timeout = 5
|
@@ -33,6 +36,7 @@ class TinysshOptparse
|
|
33
36
|
opts.on("-l", "--list-file [file]",
|
34
37
|
"File containing a list of hosts' IP Address") do |file|
|
35
38
|
options.host_file = file
|
39
|
+
return true
|
36
40
|
end
|
37
41
|
|
38
42
|
opts.on("-o", "--output-file [file]",
|
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: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- William Herry
|