fix ethinfo

This commit is contained in:
Bard 2023-10-09 02:25:34 +08:00 committed by GitHub
parent f0fb9596e8
commit d12ebf7386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ for ifname, stat in pairs(util.ubus("network.device", "status")) do
status = stat.carrier and "yes" or "no" status = stat.carrier and "yes" or "no"
if stat.speed:sub(1, 1) == "-" then if stat.speed == nil or stat.speed:sub(1, 1) == "-" then
speed = "-" speed = "-"
else else
speed = stat.speed:sub(1, -2) .. "Mb/s" speed = stat.speed:sub(1, -2) .. "Mb/s"