Browse Source

Merge pull request #1888 from arfett/master

mwan3-luci updated to 1.4-4
lilik-openwrt-22.03
Steven Barth 9 years ago
parent
commit
7c05f9b4de
4 changed files with 12 additions and 10 deletions
  1. +1
    -1
      net/mwan3-luci/Makefile
  2. +9
    -7
      net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua
  3. +1
    -1
      net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/openwrt_overview_status.htm
  4. +1
    -1
      net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/overview_interface.htm

+ 1
- 1
net/mwan3-luci/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-mwan3
PKG_VERSION:=1.4
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
PKG_LICENSE:=GPLv2


+ 9
- 7
net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua View File

@ -3,6 +3,8 @@ module("luci.controller.mwan3", package.seeall)
sys = require "luci.sys"
ut = require "luci.util"
ip = "/usr/bin/ip -4 "
function index()
if not nixio.fs.access("/etc/config/mwan3") then
return
@ -61,7 +63,7 @@ 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
if ut.trim(sys.exec(ip .. "route list table " .. ruleNumber)) ~= "" then
if ut.trim(sys.exec("uci -p /var/state get mwan3." .. interfaceName .. ".track_ip")) ~= "" then
return "online"
else
@ -183,8 +185,8 @@ function diagnosticsData(interface, tool, task)
end
elseif tool == "rulechk" then
getInterfaceNumber()
local rule1 = sys.exec("ip rule | grep $(echo $((" .. interfaceNumber .. " + 1000)))")
local rule2 = sys.exec("ip rule | grep $(echo $((" .. interfaceNumber .. " + 2000)))")
local rule1 = sys.exec(ip .. "rule | grep $(echo $((" .. interfaceNumber .. " + 1000)))")
local rule2 = sys.exec(ip .. "rule | grep $(echo $((" .. interfaceNumber .. " + 2000)))")
if rule1 ~= "" and rule2 ~= "" then
results = "All required interface IP rules found:\n\n" .. rule1 .. rule2
elseif rule1 ~= "" or rule2 ~= "" then
@ -194,7 +196,7 @@ function diagnosticsData(interface, tool, task)
end
elseif tool == "routechk" then
getInterfaceNumber()
local routeTable = sys.exec("ip route list table " .. interfaceNumber)
local routeTable = sys.exec(ip .. "route list table " .. interfaceNumber)
if routeTable ~= "" then
results = "Interface routing table " .. interfaceNumber .. " was found:\n\n" .. routeTable
else
@ -283,17 +285,17 @@ function troubleshootingData()
mArray.routeshow = { routeShow }
-- ip rule show
local ipRuleShow = ut.trim(sys.exec("ip rule show"))
local ipRuleShow = ut.trim(sys.exec(ip .. "rule show"))
if ipRuleShow == "" then
ipRuleShow = "No data found"
end
mArray.iprule = { ipRuleShow }
-- ip route list table 1-250
local routeList, routeString = ut.trim(sys.exec("ip rule | sed 's/://g' | awk '$1>=2001 && $1<=2250' | awk '{print $NF}'")), ""
local routeList, routeString = ut.trim(sys.exec(ip .. "rule | sed 's/://g' | awk '$1>=2001 && $1<=2250' | awk '{print $NF}'")), ""
if routeList ~= "" then
for line in routeList:gmatch("[^\r\n]+") do
routeString = routeString .. line .. "\n" .. sys.exec("ip route list table " .. line)
routeString = routeString .. line .. "\n" .. sys.exec(ip .. "route list table " .. line)
end
routeString = ut.trim(routeString)
else


+ 1
- 1
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/openwrt_overview_status.htm View File

@ -6,7 +6,7 @@
if (mArray.wans)
{
var temp = '';
for( var i = 0; i < mArray.wans.length; i++ )
for ( var i = 0; i < mArray.wans.length; i++ )
{
var stat = '';
var cssc = '';


+ 1
- 1
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan/overview_interface.htm View File

@ -14,7 +14,7 @@
if (mArray.wans)
{
var interfaceStatus = '';
for( var i = 0; i < mArray.wans.length; i++ )
for ( var i = 0; i < mArray.wans.length; i++ )
{
var status = '';
var css = '';


Loading…
Cancel
Save