Created
August 9, 2016 00:29
-
-
Save ryanmaclean/093fe1f719c19ce6ffc1b572be177f27 to your computer and use it in GitHub Desktop.
Mac Hostname Script
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
| #!/bin/bash | |
| newhostname=nmp | |
| echo "$(ipconfig getifaddr en0) $newhostname" | sudo tee -a /etc/hosts | |
| sudo scutil --set HostName $newhostname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment