diff options
| author | Florian Eckert <fe@dev.tdt.de> | 2017-10-25 13:46:15 +0200 |
|---|---|---|
| committer | Florian Eckert <fe@dev.tdt.de> | 2017-12-11 15:21:16 +0100 |
| commit | 78acfcc7ed0696cc2e0f83cb493c59e30af29247 (patch) | |
| tree | 57c2e0295db031e36fc30aeffec9fe05ed999c92 | |
| parent | 58a1a733e5bad2601c959f36c78ae759c3d38b3e (diff) | |
net/mwan3-luci: fix iface_state on on status page
Since commit 4739584c2434fda6c4f14b0ef3d38fa055352c0e the status of the
interface is not reported correctly anymore. To fix this issue do not test
if the routing table is presented use instead the "/var/run/iface_state/[iface]"
to get the interface state because the routing table will not get deleted
anymore if the interface is offline.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
| -rw-r--r-- | net/mwan3-luci/Makefile | 2 | ||||
| -rw-r--r-- | net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/net/mwan3-luci/Makefile b/net/mwan3-luci/Makefile index 8c77394da..fa2a24409 100644 --- a/net/mwan3-luci/Makefile +++ b/net/mwan3-luci/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-mwan3 PKG_VERSION:=1.4 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_MAINTAINER:=Aedan Renner <chipdankly@gmail.com> PKG_LICENSE:=GPLv2 diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua b/net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua index 3d5a23dd0..bec0e6b27 100644 --- a/net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua +++ b/net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua @@ -65,7 +65,8 @@ end function getInterfaceStatus(ruleNumber, interfaceName) if ut.trim(sys.exec("uci -p /var/state get mwan3." .. interfaceName .. ".enabled")) == "1" then - if ut.trim(sys.exec(ip .. "route list table " .. ruleNumber)) ~= "" then + local fs = require "nixio.fs" + if fs.readfile("/var/run/mwan3/iface_state/%s" % interfaceName) == "online" then if ut.trim(sys.exec("uci -p /var/state get mwan3." .. interfaceName .. ".track_ip")) ~= "" then return "online" else |
