Created
August 11, 2014 08:17
-
-
Save anonymous/63cc55f3397db9de1ec6 to your computer and use it in GitHub Desktop.
This file contains 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
random_mac(){ | |
local i; for i in wireless.@wifi-iface[0] network.lan; do | |
local mac; while [ "${#mac}" != "17" ]; do | |
mac=00$(hexdump -n5 -e '/1 ":%02x"' /dev/urandom) | |
done | |
echo ${mac} | |
uci set ${i}.macaddr=${mac} | |
uci commit ${i%%.*} | |
unset mac | |
done | |
}t random_mac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment