owssh 0.0.10 → 0.0.11
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 +8 -2
- 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: 9f3516db22ba0702c4d39f65bdb2e64aa9407eb1
|
|
4
|
+
data.tar.gz: e47256725edd0e905d64a53975700381ecc60836
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b799403de1532ad01ee54799084075473fbfcaaf611267079e26eea934a1a5c09f94c59ec9f217fe1521b147d083b523bbf4f8e183a7b38fad8a453b19f1fa96
|
|
7
|
+
data.tar.gz: ba57548dea4b5b0709fe491f05c09b4e6dcb2edad3eef716546fcc40e4fea4185185f578dbb9d343533afd3f0f725367cabb89bb0c0f62c69993f00b896c1524
|
data/lib/owssh.rb
CHANGED
|
@@ -26,7 +26,13 @@ class Owssh
|
|
|
26
26
|
instances_json['Instances'].each do |instance|
|
|
27
27
|
pub_ip = instance['ElasticIp'] || instance['PublicIp'] || "DOWN"
|
|
28
28
|
priv_ip = instance['PrivateIp'] || "N/A"
|
|
29
|
-
|
|
29
|
+
puts "Hostname: #{instance['Hostname']}"
|
|
30
|
+
match = instance['Hostname'].match(/(.*)\d+/) resque nil
|
|
31
|
+
if !match.nil? then
|
|
32
|
+
type = match[1].to_s
|
|
33
|
+
else
|
|
34
|
+
type = "N/A"
|
|
35
|
+
end
|
|
30
36
|
my_instances[instance['Hostname'].to_s] = { "PUB_IP" => pub_ip.to_s, "PRIV_IP" => priv_ip.to_s, "TYPE" => type }
|
|
31
37
|
end
|
|
32
38
|
my_instances
|
|
@@ -74,7 +80,7 @@ class Owssh
|
|
|
74
80
|
puts "owssh [Stack Name] [Hostname or Type] - SSH to a host in a stack"
|
|
75
81
|
puts "owssh [Stack Name] [Hostname or Type] \"Your command here\" - SSH to a host in a stack and run a command"
|
|
76
82
|
puts ""
|
|
77
|
-
puts " Type
|
|
83
|
+
puts " Type - The type of host. I.E. rails-app, resque, etc..."
|
|
78
84
|
puts " Hostname - The name of the host. I.E. rails-app1, resque1, etc..."
|
|
79
85
|
exit
|
|
80
86
|
end
|