owssh 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/owssh.rb +14 -17
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14a2d860d3a2648cec43c800594c5c5d5013dd90
4
- data.tar.gz: 5d80f0cb09a39460e001cf76b3f6e278a9273de6
3
+ metadata.gz: 6b161ee0d08fc58e74e54d70ac70a1ea5d549949
4
+ data.tar.gz: f8e60739dc58923bf7da860d02975266b88f7c4f
5
5
  SHA512:
6
- metadata.gz: d55539670799752744f78aabc641ff8b9cd6d9325f50c5dd9914215e66161553bbe73d9d93b9ef9d717e3c2835cd7563296b8e412dccb817bb14445e4bc75937
7
- data.tar.gz: 5733a0b9ab0072a482442860299c0bc69d6a02f7e1ba8d6e2d5ad6803504e98a4b780d6ca605bfaeddfc8c7040c24034297c2dd482b03882594d71e3692624a3
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
- puts "Instance with name '#{ARGV[1]}' not found"
150
- exit
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..."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: owssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Hutchins