Created
April 22, 2010 20:29
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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