Last active
May 8, 2020 14:34
-
-
Save vazgen6/322f97802de0dbe012fcd976b53b675b to your computer and use it in GitHub Desktop.
Changes mac address of given network interface name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
interface=$1 | |
if [ -z "$interface" ] | |
then | |
echo "Please pass interface name" | |
echo "Example: ./change-mac wlan0" | |
exit | |
fi | |
sudo ifconfig $interface down | |
sudo macchanger -r $interface | |
sudo ifconfig $interface up |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment