Created
December 17, 2010 00:25
-
-
Save hedgehog/744276 to your computer and use it in GitHub Desktop.
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
| #!/bin/bash | |
| HOSTNAME=<%= @node_name %> | |
| echo "Take one: $CHEF_NODE_NAME" | |
| echo "Take two: $HOSTNAME" | |
| DOMAIN=taqtik.com | |
| hostname $HOSTNAME | |
| echo $HOSTNAME> /etc/hostname | |
| IPADDR=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'` | |
| echo $IPADDR >/tmp/ip_current | |
| sed -i "s/127.0.0.1[[:space:]]localhost/127.0.0.1 localhost\n$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME\n/g" /etc/hosts | |
| sed -i "s/127.0.1.1[[:space:]]vagrantup.com[[:space:]]vagrantup/$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME\n/g" /etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment