Created
May 28, 2013 11:07
-
-
Save rhoml/5662004 to your computer and use it in GitHub Desktop.
Add this to your bash_profile of your OSX profile and enjoy.
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
publicdns() { | |
EC2_DESCRIBE_INSTANCES=`which ec2-describe-instances | awk '{print $3}'` | |
EC2_DESCRIBE_GROUP=`which ec2-describe-group | awk '{print $3}'` | |
SECURITY_GROUP="$1" | |
AWS_CERT=~/.ec2/cert.pem | |
AWS_PK=~/.ec2/pk.pem | |
echo "This are the Available servers on ${SECURITY_GROUP} security group." | |
${EC2_DESCRIBE_INSTANCES} -C ${AWS_CERT} -K ${AWS_PK} | grep INSTANCE | grep `${EC2_DESCRIBE_GROUP} -C ${AWS_CERT} -K ${AWS_PK} ${SECURITY_GROUP} | head -1 | awk '{print $2}'` | awk '{print $4 }' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment