Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Operating System (http://www.mac-forums.com/forums/os-x-operating-system/)
-   -   Mac Address in Computer Name (http://www.mac-forums.com/forums/os-x-operating-system/126902-mac-address-computer-name.html)

beardiebeardie 10-16-2008 05:27 AM

Mac Address in Computer Name
 
Hi Guys

Sorry if this has been covered, I had a look but I couldn't see anything.

Does anyone know how to set up the mac address of the mac as the computer name via a shell script.

Thanks in advance

beardiebeardie 10-16-2008 11:00 PM

Dont worry I think I have found it it is something like this

HWADDRESS=`ifconfig en0 | grep ether | awk '{print $2}'`

NONAME=`echo $HWADDRESS | awk '{ gsub(":", ""); print $0}'`

sudo scutil --set ComputerName AP$NONAME

sudo scutil --set HostName AP$NONAME


All times are GMT -4. The time now is 11:04 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.