Jump to content

Applescript to set your MAC address on startup

MAC address

  • Please log in to reply
No replies to this topic

#1
Cerastez

Cerastez

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 158 posts
  • Gender:Female
  • Location:Bellingham, WA, USA
There are several ethernet cards out there that work, but will give a MAC address of all zeros, 00:00:00:00:00:00 You have to use the terminal each time you restart to set the MAC address. This applescript will automatically set the MAC address on startup. You won't have to do anything, it is all automatic.

1. Open AppleScript Editor and paste the following into a new file.

set newMac to "00:13:72:1B:FF:D1"
set psswrd to "your_password"

repeat with counter from 0 to 50
try
set currMac to (do shell script "ifconfig en0" & " | grep 'ether '")
if currMac contains "ether" then
exit repeat
end if
on error
delay 2
end try
end repeat

do shell script "ifconfig en0" & " ether " & newMac password psswrd with administrator privileges


2. Replace 00:13:72:1B:FF:D1 and your_password with your own MAC address and password.

3. Save the AppleScript in File Format Application and check the Run Only box. Name it something descriptive like "SetMacAdd." Save it in Applications or somewhere else where you can find it.

4. Open System Preferences and click on Accounts.

5. In Accounts click on the Login Items tab and the use the "+" to add your saved AppleScript to the list of login items.

6. Restart to check if it works.


*Systems running Tiger will use lladdr instead of ether in the script.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   Web hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy