Mac Address in Computer Name

Joined
Aug 7, 2007
Messages
16
Reaction score
0
Points
1
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
 
OP
B
Joined
Aug 7, 2007
Messages
16
Reaction score
0
Points
1
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
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top