From 15a992e3b3a714d1f6fb549485aacca232bb537d Mon Sep 17 00:00:00 2001 From: Ycarus Date: Tue, 16 Oct 2018 08:21:32 +0200 Subject: [PATCH] New way to get gw --- luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 4e853652e..e1e6e3e36 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -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