summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2017-04-18 15:40:03 +0300
committerGitHub <noreply@github.com>2017-04-18 15:40:03 +0300
commitcee4427eeb2bad50017eaa5375da425c737c4190 (patch)
tree4dbc0d5b12b779b220fa35fe94140928ded8c4dc
parent91c0b91a2e1903ee697c214ff7d8fffac559c424 (diff)
parentd912d6bb4740322da290d1ecd19225d413b2ae9a (diff)
Merge pull request #1110 from psyborg55/psyborg55-patch-1
luci-app-mwan3: disable uci/sed errors print to syslog
-rw-r--r--applications/luci-app-mwan3/luasrc/controller/mwan3.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua
index 3d5a23dd03..d3fd150692 100644
--- a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua
+++ b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua
@@ -64,9 +64,9 @@ function index()
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("uci -q -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("uci -p /var/state get mwan3." .. interfaceName .. ".track_ip")) ~= "" then
+ if ut.trim(sys.exec("uci -q -p /var/state get mwan3." .. interfaceName .. ".track_ip")) ~= "" then
return "online"
else
return "notMonitored"
@@ -102,7 +102,7 @@ function interfaceStatus()
wansid = {}
for wanName, interfaceState in string.gfind(statusString, "([^%[]+)%[([^%]]+)%]") do
- local wanInterfaceName = ut.trim(sys.exec("uci -p /var/state get network." .. wanName .. ".ifname"))
+ local wanInterfaceName = ut.trim(sys.exec("uci -q -p /var/state get network." .. wanName .. ".ifname"))
if wanInterfaceName == "" then
wanInterfaceName = "X"
end
@@ -115,7 +115,7 @@ function interfaceStatus()
end
-- overview status log
- local mwanLog = ut.trim(sys.exec("logread | grep mwan3 | tail -n 50 | sed 'x;1!H;$!d;x'"))
+ local mwanLog = ut.trim(sys.exec("logread | grep mwan3 | tail -n 50 | sed 'x;1!H;$!d;x' 2>/dev/null"))
if mwanLog ~= "" then
mArray.mwanlog = { mwanLog }
end
@@ -163,7 +163,7 @@ function diagnosticsData(interface, tool, task)
results = "MWAN3 started"
end
else
- local interfaceDevice = ut.trim(sys.exec("uci -p /var/state get network." .. interface .. ".ifname"))
+ local interfaceDevice = ut.trim(sys.exec("uci -q -p /var/state get network." .. interface .. ".ifname"))
if interfaceDevice ~= "" then
if tool == "ping" then
local gateway = ut.trim(sys.exec("route -n | awk '{if ($8 == \"" .. interfaceDevice .. "\" && $1 == \"0.0.0.0\" && $3 == \"0.0.0.0\") print $2}'"))
@@ -172,7 +172,7 @@ function diagnosticsData(interface, tool, task)
local pingCommand = "ping -c 3 -W 2 -I " .. interfaceDevice .. " " .. gateway
results = pingCommand .. "\n\n" .. sys.exec(pingCommand)
else
- local tracked = ut.trim(sys.exec("uci -p /var/state get mwan3." .. interface .. ".track_ip"))
+ local tracked = ut.trim(sys.exec("uci -q -p /var/state get mwan3." .. interface .. ".track_ip"))
if tracked ~= "" then
for z in tracked:gmatch("[^ ]+") do
local pingCommand = "ping -c 3 -W 2 -I " .. interfaceDevice .. " " .. z
@@ -301,7 +301,7 @@ function troubleshootingData()
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' 2>/dev/null | 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)
@@ -313,7 +313,7 @@ function troubleshootingData()
mArray.routelist = { routeString }
-- default firewall output policy
- local firewallOut = ut.trim(sys.exec("uci -p /var/state get firewall.@defaults[0].output"))
+ local firewallOut = ut.trim(sys.exec("uci -q -p /var/state get firewall.@defaults[0].output"))
if firewallOut == "" then
firewallOut = "No data found"
end