openwrt部分文件解析

/usr/libexec/rpcd/luci文件

getLocaltime

setLocaltime

getTimezones

getLEDs 获取led的亮度

getUSBDevices获取usb设备信息

getConntrackHelpers

getFeatures

getSwconfigFeatures

getSwconfigPortState

setPassword

getBlockDevices

setBlockDetect

getMountPoints

getRealtimeStats

getConntrackList

getProcessList

 

 

 

if arg[1] == "list" then
local _, method, rv = nil, nil, {}
for _, method in pairs(methods) do rv[_] = method.args or {} end
print((json.stringify(rv):gsub(":%[%]", ":{}")))
elseif arg[1] == "call" then
local args = parseInput()
local method = validateArgs(arg[2], args)
local result, code = method.call(args)
print((json.stringify(result):gsub("^%[%]$", "{}")))
os.exit(code or 0)
end

posted @ 2021-04-24 17:45  轻轻的吻  阅读(300)  评论(0编辑  收藏  举报