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

New way to get gw

This commit is contained in:
Ycarus 2018-10-16 08:21:32 +02:00
parent e15e1da8b5
commit 15a992e3b3

View file

@ -711,6 +711,9 @@ function interfaces_status()
if connectivity ~= "ERROR" and gateway == "" and ifname ~= nil then
if fs.access("/sys/class/net/" .. ifname) then
gateway = ut.trim(sys.exec("ip -4 r list dev " .. ifname .. " | grep kernel | awk '/proto kernel/ {print $1}' | grep -v / | tr -d '\n'"))
if gateway == "" then
gateway = ut.trim(sys.exec("ip -4 r list dev " .. ifname .. " | grep default | awk '{print $3}' | tr -d '\n'"))
end
end
end
if connectivity ~= "ERROR" and gateway ~= "" then