Created
January 3, 2017 01:32
-
-
Save nyboer/1fc232e0d006b656d2b724698c7ff90f to your computer and use it in GitHub Desktop.
rename CHIP hostname for easy network access
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
# call this with an argument for the new name | |
new=${1:-toto} | |
OLD=$(hostname) | |
echo "New name for chip is ${new}" | |
echo $old | |
sudo sed -i "s/${OLD}/${new}/g" /etc/hostname | |
sudo sed -i "s/${OLD}/${new}/g" /etc/hosts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment