Skip to content

Instantly share code, notes, and snippets.

@pascalandy
Last active November 8, 2016 01:19
Show Gist options
  • Save pascalandy/c6d10e8567e2c81d080c532ed7bbb762 to your computer and use it in GitHub Desktop.
Save pascalandy/c6d10e8567e2c81d080c532ed7bbb762 to your computer and use it in GitHub Desktop.
Renames the host to have a suffix of alexellisio
# Renames the host to have a suffix of alexellisio
export NEW_HOST_NAME=N12-AMS1
export ORIGINAL=$(cat /etc/hostname)
echo $NEW_HOST_NAME
echo $ORIGINAL
sudo hostname $NEW_HOST_NAME
echo $NEW_HOST_NAME | sudo tee /etc/hostname
reboot
— — — — — — — — — — — — — — — —
# Renames the host to have a suffix of alexellisio
export original=$(cat /etc/hostname)
sudo hostname $original-alexellisio
echo $original-alexellisio | sudo tee /etc/hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment