owssh 0.0.6 → 0.0.7
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.
- checksums.yaml +4 -4
- data/lib/owssh.rb +14 -17
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b161ee0d08fc58e74e54d70ac70a1ea5d549949
|
4
|
+
data.tar.gz: f8e60739dc58923bf7da860d02975266b88f7c4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ef50f80c9a25ed4d2464c4497ab8debe4681b4b9960c4261b554c2b76ef8314cac735dff197c218d7608cb5820ac4f0b9fd7412033d3737f51d108bcd649a79
|
7
|
+
data.tar.gz: b7793469b698b6630b07e56c6031de20e59974b168b4fbfca44419aac67c5eb1491603ebd397b54fd5c22070dcc875f6ed8c4cb7a56474c53f2f34363bb14224
|
data/lib/owssh.rb
CHANGED
@@ -129,25 +129,22 @@ class Owssh
|
|
129
129
|
# Run command through SSH on host
|
130
130
|
puts "Running comand #{ARGV[2]} on host #{ARGV[1]}..."
|
131
131
|
exec("ssh -i ~/.ssh/id_rsa_dev ubuntu@#{$instances[ARGV[1].to_s]} '#{ARGV[2]}'")
|
132
|
-
else
|
133
|
-
$first_instance = ""
|
134
|
-
$instances.each do |instance_name, data|
|
135
|
-
unless (instance_name =~ /#{ARGV[1].to_s}(.*)/).nil?
|
136
|
-
$first_instance = instance_name
|
137
|
-
break
|
138
|
-
end
|
139
|
-
end
|
140
|
-
if $first_instance == "" then
|
141
|
-
puts "Could not find suitable host of type #{ARGV[1]}"
|
142
|
-
exit
|
143
|
-
else
|
144
|
-
puts "Running comand #{ARGV[2]} on first host of type #{ARGV[1]} which is #{$first_instance}..."
|
145
|
-
exec("ssh -i ~/.ssh/id_rsa_dev ubuntu@#{$first_instance.to_s} '#{ARGV[2]}'")
|
146
|
-
end
|
147
132
|
end
|
148
133
|
else
|
149
|
-
|
150
|
-
|
134
|
+
$first_instance = ""
|
135
|
+
$instances.each do |instance_name, data|
|
136
|
+
unless (instance_name =~ /#{ARGV[1].to_s}(.*)/).nil?
|
137
|
+
$first_instance = instance_name
|
138
|
+
break
|
139
|
+
end
|
140
|
+
end
|
141
|
+
if $first_instance == "" then
|
142
|
+
puts "Could not find host with name or type of '#{ARGV[1]}'"
|
143
|
+
exit
|
144
|
+
else
|
145
|
+
puts "Running comand #{ARGV[2]} on first host of type #{ARGV[1]} which is #{$first_instance}..."
|
146
|
+
exec("ssh -i ~/.ssh/id_rsa_dev ubuntu@#{$first_instance.to_s} '#{ARGV[2]}'")
|
147
|
+
end
|
151
148
|
end
|
152
149
|
else
|
153
150
|
puts "I don't quite understand what you're asking me to do..."
|