Skip to content

Instantly share code, notes, and snippets.

@nyboer
Created January 3, 2017 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nyboer/1fc232e0d006b656d2b724698c7ff90f to your computer and use it in GitHub Desktop.
Save nyboer/1fc232e0d006b656d2b724698c7ff90f to your computer and use it in GitHub Desktop.
rename CHIP hostname for easy network access
# 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