ethinfo: add lan

This commit is contained in:
Bard 2024-04-07 05:46:15 +08:00 committed by GitHub
parent ba3ebf0b74
commit c02b47b4b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,7 +7,7 @@ local jsonc = require "luci.jsonc"
local eth_info = {} local eth_info = {}
local ifname, stat local ifname, stat
for ifname, stat in pairs(util.ubus("network.device", "status")) do for ifname, stat in pairs(util.ubus("network.device", "status")) do
if ifname:match("^(eth%d+)$") == ifname or ifname:match("^(usb%d+)$") == ifname then if ifname:match("^(eth%d+)$") == ifname or ifname:match("^(usb%d+)$") or ifname:match("^(lan%d+)$") == ifname then
local status, speed, duplex local status, speed, duplex
status = stat.carrier and "yes" or "no" status = stat.carrier and "yes" or "no"