Created
July 28, 2015 15:38
-
-
Save anonymous/622da1f6660325a6c766 to your computer and use it in GitHub Desktop.
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/sh | |
# get machine serial number | |
MAC_SERIAL_NUMBER=`ioreg -l | grep IOPlatformSerialNumber|awk '{print $4}' | cut -d \" -f 2` | |
# echo the value prefixed by "RuntimeSetBindingComputerID:" to make it compatible with the directory binding tasks | |
echo "RuntimeSetBindingComputerID: ${MAC_SERIAL_NUMBER}" | |
systemsetup -setcomputername ${MAC_SERIAL_NUMBER} | |
/usr/sbin/scutil --set LocalHostName ${MAC_SERIAL_NUMBER} | |
/usr/sbin/scutil --set HostName ${MAC_SERIAL_NUMBER} | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment