Last active
January 19, 2017 21:14
-
-
Save mikfreedman/10294278 to your computer and use it in GitHub Desktop.
rename machine
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
hostname=ENV['HOSTNAME'] | |
[ | |
"scutil --set ComputerName #{hostname}", | |
"scutil --set LocalHostName #{hostname}", | |
"scutil --set HostName #{hostname}", | |
"hostname #{hostname}", | |
"diskutil rename / #{hostname}" ].each do |host_cmd| | |
`#{host_cmd}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey why don't you get the file type right! .sh -> .rb