module("luci.controller.pubapi.ifacestatus", package.seeall)
function index()
--entry({"click", "here", "now"}, call("iface_status_ip"), nil)
entry({"ifacewanip"}, call("iface_wan_ip"), "iface wan ip", 10).dependent=false
end
function iface_wan_ip()
local netm = require "luci.model.network".init()
local rv = { }
local ifaces= "wan"
local iface
for iface in ifaces:gmatch("[%w%.%-_]+") do
local net = netm:get_network(iface)
local device = net and net:get_interface()
if device then
local data = {
id = iface,
desc = net:get_i18n(),
proto = net:proto(),
uptime = net:uptime()
luci 获取ifaces信息模块
最新推荐文章于 2021-03-21 08:26:24 发布