I’ve got a little script I’ve been using to change my macs, outside of anonsurf. It makes a pc look like a macintosh. Can you tell me what you think of it and how I might be able to improve it?
It coulde be easier and more usable (especial when you work with external wifi dongle)
to get the interface name as an argument.
You dont need those sleep times, 0.5 - 1 sec far more than enough
For example the script name is mac.sh
#the script will exit if not run as root
#check the user id
if [ $EUID -ne "0" ]
then
echo "Run as root!"
exit
fi
#$1 is the first argument
#check if any interface specified
if [ -z $1 ]
then
echo "No interface specified!"
exit
else
INTERFACE=("$1")
fi
#check the given interface
if [[ -z $(ifconfig | grep -e "$INTERFACE") ]]
then
echo "Not a valid interface!"
exit
fi
service network-manager stop
sleep 0.5
ifconfig $INTERFACE down
sleep 0.5
macchanger -m 1c:ab:a7:00:00:01 $INTERFACE
sleep 0.5
ifconfig $INTERFACE up
sleep 0.5
service network-manager start
For example: sudo bash mac.sh wlan0
change the mac address of wlan0
It is a bit complex for first, but need because of the typos