update 2026-07-15 14:09:58

This commit is contained in:
action committed 2026-07-15 14:09:58 +08:00
1 parent c2d17d02c4
commit a67d83bfc0
1970 files changed
+107 -1523279

No files matched your search

-45
View File
@@ -1,45 +0,0 @@
#!/usr/bin/lua
-- Copyright (C) 2022 ImmortalWrt.org
local util = require "luci.util"
local jsonc = require "luci.jsonc"
local eth_info = {}
local ifname, stat
for ifname, stat in pairs(util.ubus("network.device", "status")) do
while true do
if (ifname:match("^(br-.+)$")) == ifname then
break
else
local status, speed, duplex
if(stat.speed ~= nil) then
status = stat.carrier and 1 or 0
if stat.speed:sub(1, 1) == "-" then
speed = " - "
else
speed = stat.speed:sub(1, -2) .. "Mb/s"
end
if stat.carrier and stat.speed:sub(-1) == "F" then
duplex = 1
else
duplex = 0
end
eth_info[#eth_info+1] = { name = ifname, status = status,
speed = speed, duplex = duplex }
end
break
end
end
end
table.sort(eth_info,
function(a, b)
return a.name < b.name
end)
print(jsonc.stringify(eth_info))