owssh 0.0.24 → 0.0.26

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 +9 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b7c5df9ec5ed6e88be77d7d3c10da78e06f6ebd
4
- data.tar.gz: 378312a4507c952bba9fb1bdedad5099de2b8499
3
+ metadata.gz: 7434709490670ead54c5b8208aeb2538aba01b05
4
+ data.tar.gz: 22b00f467185c3cac795fbfeff3050512d198c0f
5
5
  SHA512:
6
- metadata.gz: 58e0c8b334a72df8e4262f953cd9233f2dee5e9d9c3aa37afea728ae04d00eb2ce4e94641e04a23ac54cd86c6edc61731bf46fcb31bf6daf2915db4f0eb9c347
7
- data.tar.gz: 174e765b0e485b0cb71330eeaf5f464ab6f35fba8918463f36085cc8e447463a0d7fe6ee69c79e51c3c612a162a6c626329cbb6822cb94e4ab585f10aa7957fa
6
+ metadata.gz: 871f80bbd0ed339792a95d00b6ae2cbe1fae947ce82b2a150e27841f07d4c70258c761a2dee4983c0a28d6f6e52831d15263e145ca12c7e19571bf3e0e487487
7
+ data.tar.gz: fb3281260546a145b60f5961391bc48bebc9d19d02937f4758116e01f73f79f36621ed95af90c24bf29c469811eb1c328b975a8aa30c2896fc3d4c1c37ba9a8c
data/lib/owssh.rb CHANGED
@@ -75,6 +75,10 @@ class Owssh
75
75
  end
76
76
  end
77
77
 
78
+ def ssh_connect(connect_user, su_to_user, ssh_key, command)
79
+
80
+ end
81
+
78
82
  def print_help
79
83
  puts "Version #{Gem.loaded_specs['owssh'].version}"
80
84
  puts ""
@@ -83,7 +87,7 @@ class Owssh
83
87
  puts "owssh describe - Show details of hosts in all stacks"
84
88
  puts "owssh describe [Stack Name] - Show details of a specific stack"
85
89
  puts "owssh [Stack Name] [Hostname or Type] - SSH to a host in a stack"
86
- puts "owssh [Stack Name] [Hostname or Type] \"Your command here\" - SSH to a host in a stack and run a command"
90
+ puts "owssh [Stack Name] [Hostname or Type] \"Your command here\" - SSH to a host in a stack and run a command"
87
91
  puts ""
88
92
  puts " Type - The type of host. I.E. rails-app, resque, etc..."
89
93
  puts " Hostname - The name of the host. I.E. rails-app1, resque1, etc..."
@@ -96,6 +100,7 @@ class Owssh
96
100
  $aws_profile = ENV['AWS_DEFAULT_PROFILE'] || "default"
97
101
  $ssh_key_file = ENV['OWSSH_SSH_KEY_FILE'] || "~/.ssh/id_rsa_owssh"
98
102
  $aws_config_file = ENV['OWSSH_AWS_CONFIG_FILE'] || ENV['AWS_CONFIG_FILE'] || "~/.aws/config.owssh"
103
+ $ssh_user = ENV['OWSSH_USER'] || "ubuntu"
99
104
 
100
105
  if ARGV.empty?
101
106
  puts "Please supply some options. Try 'owssh help' for available commands"
@@ -148,11 +153,11 @@ class Owssh
148
153
  # SSH to specific host
149
154
  if ARGV[2].nil? then
150
155
  puts "Opening SSH connection to #{ARGV[1]}..."
151
- exec("ssh -i #{$ssh_key_file} ubuntu@#{$instances[ARGV[1].downcase.to_s]['PUB_IP']}")
156
+ exec("ssh -i #{$ssh_key_file} #{$ssh_user}@#{$instances[ARGV[1].downcase.to_s]['PUB_IP']}")
152
157
  elsif ARGV[3].nil? then
153
158
  # Run command through SSH on host
154
159
  puts "Running comand #{ARGV[2]} on host #{ARGV[1]}..."
155
- exec("ssh -i #{$ssh_key_file} ubuntu@#{$instances[ARGV[1].downcase.to_s]['PUB_IP']} '#{ARGV[2]}'")
160
+ exec("ssh -i #{$ssh_key_file} #{$ssh_user}@#{$instances[ARGV[1].downcase.to_s]['PUB_IP']} '#{ARGV[2]}'")
156
161
  end
157
162
  else
158
163
  # SSH to first instance of certain type
@@ -172,7 +177,7 @@ class Owssh
172
177
  else
173
178
  puts "Running command '#{ARGV[2]}' on first host of type '#{ARGV[1]}' which is '#{$first_instance}'..."
174
179
  end
175
- exec("ssh -i #{$ssh_key_file} ubuntu@#{$instances[$first_instance.to_s]['PUB_IP']} '#{ARGV[2]}'")
180
+ exec("ssh -i #{$ssh_key_file} #{$ssh_user}@#{$instances[$first_instance.to_s]['PUB_IP']} '#{ARGV[2]}'")
176
181
  end
177
182
  end
178
183
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: owssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Hutchins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-27 00:00:00.000000000 Z
11
+ date: 2014-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: command_line_reporter