Mac Forums

Mac Forums (
-   OS X - Operating System (
-   -   Mac Address in Computer Name (

beardiebeardie 10-16-2008 04: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 10: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 01:30 PM.

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