Randomize MAC Address Using Platypus I am running the following script in Platypus but the MAC address does not change:

#!/bin/zsh

IF=en7

mac=`ifconfig $IF | awk '/ether/{print $2}'`
echo "$IF mac before change=$mac"
randmac=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
sudo ifconfig $IF ether $randmac
mac=`ifconfig $IF | awk '/ether/{print $2}'`
echo "$IF mac after change=$mac"


Not receiving errors anymore.  However, the MAC address is not changed by the script.  Commands work individually pasted into Terminal, but not executed as an application by Platypus.

Platypus screenshot:
Platypus

Use Platypus to create an application from your bash script. This approach avoids needing to use AppleScript.


  Platypus is a developer tool that creates native Mac applications from command line scripts such as shell scripts or Perl, Ruby and Python programs. This is done by wrapping the script in a macOS application bundle along with an executable binary that runs the script.




Other Approaches

Mathias Bynens has an article on How to create simple Mac apps from shell scripts.

Also worth reading is the related question How to make a Mac OS X .app with a shell script?