Last active
May 16, 2017 20:08
-
-
Save wbbradley/66d818c7513d6d35dc59f21c5d83f6f6 to your computer and use it in GitHub Desktop.
put the private ip into /etc/hosts
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
# Run this after your AMI comes online | |
private_hostname=ip-$(curl http://169.254.169.254/latest/meta-data/local-ipv4 2>/dev/null | sed s/\\./-/g) | |
sudo su - -c "grep $private_hostname /etc/hosts || echo 127.0.0.1 $private_hostname >> /etc/hosts" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment