Last active
August 29, 2015 14:26
-
-
Save maccam912/d8e78539b634c7c328e3 to your computer and use it in GitHub Desktop.
Used as a post-install script in openstack to set the correct hostname
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/sh | |
set -e -x | |
sed -i 's/^127.0.1.1.*$//g' /etc/hosts | |
echo "$(curl icanhazip.com) $(hostname)" >> /etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment