owssh 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/owssh.rb +8 -9
- 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: 2df64e2216c65698450a4a8fa57ade6fa4cc7363
|
4
|
+
data.tar.gz: 9f77ada909874de1672a6c05399f50c5ac0e4dac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce5d5b484168ce151401e26a4040289e0a541fffb1a7364a6b2e977b5641326ad412e1dc1454b80323246b00500592d24258917941921c12a3edbed34d14d14a
|
7
|
+
data.tar.gz: 842a10853d7a5fc135462027530fe63acfb27651dacaaed128e21091cc69fdd4561909cdcb81f9cfa2b13af346ee2f5e34a6e331bafaba42eaf25115fec830b2
|
data/lib/owssh.rb
CHANGED
@@ -130,25 +130,24 @@ class Owssh
|
|
130
130
|
puts "Please enter an instance name. I.E. rails-app3"
|
131
131
|
exit
|
132
132
|
end
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
end
|
133
|
+
|
134
|
+
stack_name = ARGV[0].downcase
|
135
|
+
$instances = get_instances($stacks[stack_name])
|
136
|
+
|
138
137
|
if $instances.has_key?(ARGV[1]) then
|
139
138
|
# Open interactive SSH connnection
|
140
139
|
if ARGV[2].nil? then
|
141
140
|
puts "Opening SSH connection to #{ARGV[1]}..."
|
142
|
-
exec("ssh -i ~/.ssh/id_rsa_dev ubuntu@#{$instances[ARGV[1].to_s]}")
|
141
|
+
exec("ssh -i ~/.ssh/id_rsa_dev ubuntu@#{$instances[ARGV[1].to_s]['PUB_IP']}")
|
143
142
|
elsif ARGV[3].nil? then
|
144
143
|
# Run command through SSH on host
|
145
144
|
puts "Running comand #{ARGV[2]} on host #{ARGV[1]}..."
|
146
|
-
exec("ssh -i ~/.ssh/id_rsa_dev ubuntu@#{$instances[ARGV[1].to_s]} '#{ARGV[2]}'")
|
145
|
+
exec("ssh -i ~/.ssh/id_rsa_dev ubuntu@#{$instances[ARGV[1].to_s]['PUB_IP']} '#{ARGV[2]}'")
|
147
146
|
end
|
148
147
|
else
|
149
148
|
$first_instance = ""
|
150
149
|
$instances.each do |instance_name, data|
|
151
|
-
unless (instance_name =~ /#{ARGV[1].to_s}(.*)/).nil?
|
150
|
+
unless (instance_name =~ /#{ARGV[1].to_s}(.*)/).nil? || data["PublicIp"] == "DOWN"
|
152
151
|
$first_instance = instance_name
|
153
152
|
break
|
154
153
|
end
|
@@ -162,7 +161,7 @@ class Owssh
|
|
162
161
|
else
|
163
162
|
puts "Running command '#{ARGV[2]}' on first host of type '#{ARGV[1]}' which is '#{$first_instance}'..."
|
164
163
|
end
|
165
|
-
exec("ssh -i ~/.ssh/id_rsa_dev ubuntu@#{$instances[$first_instance.to_s]} '#{ARGV[2]}'")
|
164
|
+
exec("ssh -i ~/.ssh/id_rsa_dev ubuntu@#{$instances[$first_instance.to_s]['PUB_IP']} '#{ARGV[2]}'")
|
166
165
|
end
|
167
166
|
end
|
168
167
|
else
|