我的openwrt学习笔记(三十五):Openwrt之luci-lua调用uci的测试
好了 ,lua 学习 , uci也学习了,接下来就是luci
Lua中使用UCI 例子:
Luci文件源代码:
linux@ubuntu:~/linux_c/lua/lua-5.1.5/luca_study$cat test1.luci
#!/usr/bin/lua
--helloworld lua program
print("Hello World!")
require("uci")
-- Get asection type or an option
x =uci.cursor()
a =x:get("test", "abc", "test_var")
print(a)
-- Getthe configuration directory
b =x:get_confdir()
pr