Created
November 21, 2014 12:07
-
-
Save timsutton/55d4a874047d58fada16 to your computer and use it in GitHub Desktop.
Set a computer name that contains the last half of the MAC of the "Ethernet" network service
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
mac_portion=$(networksetup -getmacaddress Ethernet | egrep -o "([0-9a-f]{2}:){5}[0-9a-f]{2}" | cut -f 4-6 -d ':' | tr -d ':') | |
sudo scutil --set ComputerName "travis-${mac_portion}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment