Last active
May 5, 2021 14:55
-
-
Save AlexMunoz905/737176c8b68236de68fd2cce666fe47a to your computer and use it in GitHub Desktop.
Bash Hostname Changer
This file contains 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
#!/bin/bash | |
# Changes the hostname to what you specify. | |
# I made this for my ESXi VM templates. | |
echo -n "Set hostname to: "; | |
read hostname | |
sudo rm -rf /etc/hostname | |
echo $hostname >> hostname_temp | |
sudo cp hostname_temp /etc/hostname | |
rm -rf hostname_temp | |
echo "Hostname set to $hostname, please reboot for these changes to go into effect!"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment