Skip to content

Instantly share code, notes, and snippets.

@almoraes
Created November 10, 2017 19:33
Show Gist options
  • Save almoraes/7d6949912b841426644a66a796a37e9f to your computer and use it in GitHub Desktop.
Save almoraes/7d6949912b841426644a66a796a37e9f to your computer and use it in GitHub Desktop.
aws work around for hosts resolver
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