Last active
August 29, 2015 14:25
-
-
Save drboyer/c8f68a959ac7ceb6ab44 to your computer and use it in GitHub Desktop.
A script to query the AWS EC2 Metadata Service to display an instance's public and private IP Addresses
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 | |
privatestr="Private (local) IP:\t" | |
privatestr+=$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4) | |
echo -e $privatestr | |
publicstr="Public IP:\t\t" | |
publicstr+=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4) | |
echo -e $publicstr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment