Skip to content

Instantly share code, notes, and snippets.

@abelaska
Created April 24, 2012 12:06
Show Gist options
  • Save abelaska/2479137 to your computer and use it in GitHub Desktop.
Save abelaska/2479137 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
# SET HOSTNAME
oldname=$(hostname)
hostname "$1"
sed -i -e s/$oldname/"$1"/g /etc/hosts
sed -i -e s/$oldname/"$1"/g /etc/sysconfig/network
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment