Created
March 27, 2014 18:03
-
-
Save audibleblink/9814104 to your computer and use it in GitHub Desktop.
Sets host names based on HDD name
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/sh | |
# Summary: Sets hostnames to volume name | |
set -o errexit | |
new_name=`diskutil list | grep "2:" | awk '{print $3}'` | |
sudo scutil --set ComputerName $new_name | |
sudo scutil --set LocalHostName $new_name | |
sudo scutil --set HostName $new_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment