Created
November 10, 2017 19:33
-
-
Save almoraes/7d6949912b841426644a66a796a37e9f to your computer and use it in GitHub Desktop.
aws work around for hosts resolver
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
hosts() { | |
/bin/cp /etc/hosts-template /etc/hosts | |
echo "`curl -s http://169.254.169.254/latest/meta-data/local-ipv4` `hostname`" >> /etc/hosts | |
} | |
if [ ! -f /etc/hosts-template ]; then /bin/cp /etc/hosts /etc/hosts-template; hosts; else | |
hosts | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment