ethinfo: add usb interface

This commit is contained in:
Bard 2023-10-09 20:18:11 +08:00 committed by GitHub
parent 364c514d81
commit ba3ebf0b74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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