# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
random_mac(){
local i; for i in network.@device[0] network.wan_eth0_2_dev; do
local mac; while [ "${#mac}" != "17" ]; do
mac=A8$(hexdump -n5 -e '/1 ":%02x"' /dev/urandom)
done
echo ${mac}
uci set network.wan_eth0_2_dev.macaddr=${mac}
uci set network.lan.macaddr=${mac}
uci set network.wan.macaddr=${mac}
uci set network.lan_eth0_1_dev.macaddr=${mac}
uci commit ${i%%.*}
unset mac
done
}; random_mac
exit 0
重启随机代码
最新推荐文章于 2022-10-16 20:39:06 发布