@ -60,9 +60,9 @@ function index()
end
function getInterfaceStatus ( ruleNumber , interfaceName )
if ut.trim ( sys.exec ( " uci get -p /var/state mwan3. " .. interfaceName .. " .enabled " ) ) == " 1 " then
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 ( " uci get -p /var/state mwan3. " .. interfaceName .. " .track_ip " ) ) ~= " " then
if ut.trim ( sys.exec ( " uci -p /var/state get mwan3. " .. interfaceName .. " .track_ip " ) ) ~= " " then
return " online "
else
return " notMonitored "
@ -98,7 +98,7 @@ function interfaceStatus()
wansid = { }
for wanName , interfaceState in string.gfind ( statusString , " ([^%[]+)%[([^%]]+)%] " ) do
local wanInterfaceName = ut.trim ( sys.exec ( " uci get -p /var/state network. " .. wanName .. " .ifname " ) )
local wanInterfaceName = ut.trim ( sys.exec ( " uci -p /var/state get network. " .. wanName .. " .ifname " ) )
if wanInterfaceName == " " then
wanInterfaceName = " X "
end
@ -159,7 +159,7 @@ function diagnosticsData(interface, tool, task)
results = " MWAN3 started "
end
else
local interfaceDevice = ut.trim ( sys.exec ( " uci get -p /var/state network. " .. interface .. " .ifname " ) )
local interfaceDevice = ut.trim ( sys.exec ( " uci -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}' " ) )
@ -168,7 +168,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 get -p /var/state mwan3. " .. interface .. " .track_ip " ) )
local tracked = ut.trim ( sys.exec ( " uci -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
@ -223,16 +223,18 @@ function diagnosticsData(interface, tool, task)
end
function troubleshootingData ( )
local ver = require " luci.version "
local mArray = { }
-- software versions
local wrtRelease = ut.trim ( luci. version . distversion )
local wrtRelease = ut.trim ( ver.distversion )
if wrtRelease ~= " " then
wrtRelease = " OpenWrt - " .. wrtRelease
else
wrtRelease = " OpenWrt - unknown "
end
local luciRelease = ut.trim ( luci. version . luciversion )
local luciRelease = ut.trim ( ver.luciversion )
if luciRelease ~= " " then
luciRelease = " \n LuCI - " .. luciRelease
else
@ -300,7 +302,7 @@ function troubleshootingData()
mArray.routelist = { routeString }
-- default firewall output policy
local firewallOut = ut.trim ( sys.exec ( " uci get -p /var/state firewall.@defaults[0].output " ) )
local firewallOut = ut.trim ( sys.exec ( " uci -p /var/state get firewall.@defaults[0].output " ) )
if firewallOut == " " then
firewallOut = " No data found "
end