Created
January 1, 2016 17:37
-
-
Save utamas/36f97a63ff59891a0950 to your computer and use it in GitHub Desktop.
set-hostname
This file contains hidden or 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
set-hostname() { | |
local hostname=$1 | |
sudo hostname $hostname | |
echo "$hostname" | sudo tee /etc/hostname | |
echo "127.0.0.1 $hostname" | sudo tee -a /etc/hosts | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment