Created
August 31, 2022 17:21
-
-
Save DougBarry/34a757cffaccd6c166b5d74e6c767962 to your computer and use it in GitHub Desktop.
OpenWRT randomise access point MAC addresses
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/sh | |
get_random_mac () { | |
echo $(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\ | |
} | |
for networkid in $(uci show wireless | grep wifinet | cut -d "." -f2 | uniq | grep -v -E wifi-iface) | |
do | |
uci set wireless.${networkid}.macaddr=$(get_random_mac) | |
done | |
wifi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment