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 }; random_mac