Created
May 18, 2011 12:09
-
-
Save mihgen/978459 to your computer and use it in GitHub Desktop.
hostname_bind
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
| # In our case mac-address is easiest way to static bind hostname to server. | |
| HOSTNAME="pmo-cluster" | |
| MAC=`ifconfig eth0 | grep HWaddr | cut -c 39-` | |
| case "$MAC" in | |
| '00:24:1D:CE:71:C1') | |
| HOSTNAME="pmo-cluster1" | |
| ;; | |
| '00:24:1D:DD:FC:97') | |
| HOSTNAME="pmo-cluster4" | |
| ;; | |
| esac | |
| cat > /etc/sysconfig/network << EOF | |
| NETWORKING=yes | |
| HOSTNAME=$HOSTNAME | |
| EOF | |
| # hostname MUST provide network access to host, otherwise "rabbit" doesn't work. | |
| echo "127.0.0.1 $HOSTNAME" >> /etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment