Skip to content

Instantly share code, notes, and snippets.

@extraordinaire
Created April 22, 2010 20:29
Show Gist options
  • Save extraordinaire/375778 to your computer and use it in GitHub Desktop.
Save extraordinaire/375778 to your computer and use it in GitHub Desktop.
Turns instance parameters from xml into bash variables (for use on scalr instances)
#!/bin/bash
source /usr/local/aws/lib/lib.sh
export $(
ruby <<RUBY
require 'rexml/document'
doc = REXML::Document.new('`ec2_get_option_query_env list-role-params`')
doc.elements.each('//param') do |ele|
puts ele.attributes["name"].upcase + "=" + ele.elements[1].text
end
RUBY
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment