Jump to content

Applescript to set your MAC address on startup


Cerastez
 Share

1 post in this topic

Recommended Posts

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.

  • Like 2
Link to comment
Share on other sites

 Share

×
×
  • Create New...