Create a gist now

Instantly share code, notes, and snippets.

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