我最近了解了UCI,我想编写一些自动化脚本来配置openwrt设备。我有两个问题:
答案 0 :(得分:0)
当然,UCI随时为您服务。
以下是我的Shell脚本片段:
uci set wireless.internet='wifi-iface'
uci set wireless.internet.ifname='internet'
uci set wireless.internet.network='wwan'
uci set wireless.internet.encryption='psk-mixed'
uci set wireless.internet.device='radio0'
uci set wireless.internet.mode='sta'
uci set wireless.internet.ssid='SSID'
uci set wireless.internet.key='KEY'
MACID=$(cat /sys/class/net/eth0/address | awk '{print toupper($0)}')
uci set wireless.internet.macaddr=`echo $MACID`
uci commit wireless
最终结果: 在/ etc / config / wireless模块中输入互联网接口。
:)
是的。