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

原文地址:https://www.cnblogs.com/yuanqiangfei/p/14697565.html