openwrt在脚本中调用UCI接口, 非常值得学习

11420阅读 0评论2014-12-03 qiushui_007
分类:项目管理

官方参考 http://wiki.openwrt.org/doc/devel/config-scripting

Loading

To be able to load UCI configuration files, you need to include the common functions with:

. /lib/functions.sh

Then you can use config_load name to load config files.

The function first checks for name as absolute filename and falls back to loading it from /etc/config/ (which is the most common way of using it).


2. /lib/functions.sh: 常用函数集锦, 用法如下

config_load 配置文件名
config_foreach 遍历函数名 Section类型

config_get

上一篇:小K智能插座的openwrt分析
下一篇:openwrt中GPIO的操作, shell和LUA实现