1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Fix when iface not defined

This commit is contained in:
Ycarus 2019-05-23 19:51:44 +02:00
parent 943f1de544
commit e5874cc492

View file

@ -1092,9 +1092,11 @@ function interfaces_status()
end
end
local mtu = ut.trim(sys.exec("cat /sys/class/net/" .. ifname .. "/mtu | tr -d '\n'"))
if mtu == "" and ifname ~= nil then
mtu = uci:get("openmptcprouter",interface,"mtu") or ""
if ifname ~= nil then
local mtu = ut.trim(sys.exec("cat /sys/class/net/" .. ifname .. "/mtu | tr -d '\n'"))
if mtu == "" and ifname ~= nil then
mtu = uci:get("openmptcprouter",interface,"mtu") or ""
end
end
local data = {