Created
February 5, 2014 11:05
-
-
Save killfill/8821283 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
#Parse sysinfo output | |
eval $(/usr/bin/sysinfo -f -p | sed -e "s/^/SYSINFO_/") | |
#Config hostname | |
hostname your_hostname | |
#Setup hostname | |
eval "ipaddr=\${SYSINFO_Network_Interface_${SYSINFO_NIC_admin}_IPv4_Address}" | |
hostname > /etc/nodename | |
sed -i.bak "/${ipaddr}/d" /etc/hosts | |
printf "${ipaddr}\t$(hostname)\n" >> /etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment