-
-
Save dmamolina/ae80d42cd4d39e66196a to your computer and use it in GitHub Desktop.
This file contains 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 +x | |
function export_rc_vars | |
{ | |
if [ -f $1 ] ; then | |
ONE_VARS=`cat $1 | egrep -e '^[a-zA-Z\-\_0-9]*=' | sed 's/=.*$//'` | |
. $1 | |
for v in $ONE_VARS; do | |
export $v | |
done | |
fi | |
} | |
TMP_DIR=/tmp/one-context-tmp | |
TMP_FILE=$TMP_DIR/one-start-script | |
curl -o /tmp/context.sh http://169.254.169.254/latest/user-data | |
export_rc_vars /tmp/context.sh | |
echo -en "$START_SCRIPT_BASE64" | openssl enc -d -base64 -A > $TMP_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment