mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add ULA in wizard
This commit is contained in:
parent
6d3927ec77
commit
ac9c29af6b
2 changed files with 21 additions and 9 deletions
|
@ -306,6 +306,8 @@ function wizard_add()
|
||||||
ucic:set("openmptcprouter","settings","disable_ipv6",disableipv6)
|
ucic:set("openmptcprouter","settings","disable_ipv6",disableipv6)
|
||||||
--local ut = require "luci.util"
|
--local ut = require "luci.util"
|
||||||
--local result = ut.ubus("openmptcprouter", "set_ipv6_state", { disable_ipv6 = disableipv6 })
|
--local result = ut.ubus("openmptcprouter", "set_ipv6_state", { disable_ipv6 = disableipv6 })
|
||||||
|
local ula = luci.http.formvalue("ula") or ""
|
||||||
|
ucic:set("network","globals","ula_prefix",ula)
|
||||||
|
|
||||||
-- Get VPN set by default
|
-- Get VPN set by default
|
||||||
local default_vpn = luci.http.formvalue("default_vpn") or "glorytun_tcp"
|
local default_vpn = luci.http.formvalue("default_vpn") or "glorytun_tcp"
|
||||||
|
|
|
@ -821,7 +821,8 @@ function interfaces_status()
|
||||||
mArray.openmptcprouter["tun_state"] = "DOWN"
|
mArray.openmptcprouter["tun_state"] = "DOWN"
|
||||||
end
|
end
|
||||||
if mArray.openmptcprouter["ipv6"] == "enabled" then
|
if mArray.openmptcprouter["ipv6"] == "enabled" then
|
||||||
local tunnel_ping6_test = ut.trim(sys.exec("ping6 -w 1 -c 1 fe80::a00:1%6in4-omr6in4 | grep '100% packet loss'"))
|
local tunnel_ipv6_gw = uci:get("network","omr6in4","gateway")
|
||||||
|
local tunnel_ping6_test = ut.trim(sys.exec("ping6 -w 1 -c 1 " .. tunnel_ipv6_gw .. "%6in4-omr6in4 | grep '100% packet loss'"))
|
||||||
if tunnel_ping6_test == "" then
|
if tunnel_ping6_test == "" then
|
||||||
mArray.openmptcprouter["tun6_state"] = "UP"
|
mArray.openmptcprouter["tun6_state"] = "UP"
|
||||||
else
|
else
|
||||||
|
@ -1118,11 +1119,12 @@ function interfaces_status()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local multipath_available
|
local multipath_available = ""
|
||||||
|
local multipath_available_state = ""
|
||||||
if connectivity ~= "ERROR" and mArray.openmptcprouter["dns"] == true and ifname ~= nil and ifname ~= "" and gateway ~= "" and gw_ping == "UP" then
|
if connectivity ~= "ERROR" and mArray.openmptcprouter["dns"] == true and ifname ~= nil and ifname ~= "" and gateway ~= "" and gw_ping == "UP" then
|
||||||
-- Test if multipath can work on the connection
|
-- Test if multipath can work on the connection
|
||||||
local multipath_available_state = uci:get("openmptcprouter",interface,"mptcp_status") or ""
|
-- local multipath_available_state = uci:get("openmptcprouter",interface,"mptcp_status") or ""
|
||||||
if multipath_available_state == "" then
|
-- if multipath_available_state == "" then
|
||||||
if mArray.openmptcprouter["external_check"] ~= false then
|
if mArray.openmptcprouter["external_check"] ~= false then
|
||||||
--if mArray.openmptcprouter["service_addr"] ~= "" then
|
--if mArray.openmptcprouter["service_addr"] ~= "" then
|
||||||
-- multipath_available_state = ut.trim(sys.exec("omr-tracebox-mptcp " .. mArray.openmptcprouter["service_addr"] .. " " .. ifname .. " | grep 'MPTCP disabled'"))
|
-- multipath_available_state = ut.trim(sys.exec("omr-tracebox-mptcp " .. mArray.openmptcprouter["service_addr"] .. " " .. ifname .. " | grep 'MPTCP disabled'"))
|
||||||
|
@ -1130,12 +1132,12 @@ function interfaces_status()
|
||||||
multipath_available_state = ut.trim(sys.exec("omr-mptcp-intf " .. ifname .. " | grep 'Nay, Nay, Nay'"))
|
multipath_available_state = ut.trim(sys.exec("omr-mptcp-intf " .. ifname .. " | grep 'Nay, Nay, Nay'"))
|
||||||
--end
|
--end
|
||||||
end
|
end
|
||||||
else
|
-- else
|
||||||
multipath_available_state = ut.trim(sys.exec("echo '" .. multipath_available_state .. "' | grep 'MPTCP disabled'"))
|
-- multipath_available_state = ut.trim(sys.exec("echo '" .. multipath_available_state .. "' | grep 'MPTCP disabled'"))
|
||||||
end
|
-- end
|
||||||
if multipath_available_state == "" then
|
if multipath_available_state == "" then
|
||||||
multipath_available = "OK"
|
multipath_available = "OK"
|
||||||
--else
|
else
|
||||||
-- if mArray.openmptcprouter["external_check"] ~= false then
|
-- if mArray.openmptcprouter["external_check"] ~= false then
|
||||||
-- multipath_available_state_wan = ut.trim(sys.exec("omr-mptcp-intf " .. ifname .. " | grep 'Nay, Nay, Nay'"))
|
-- multipath_available_state_wan = ut.trim(sys.exec("omr-mptcp-intf " .. ifname .. " | grep 'Nay, Nay, Nay'"))
|
||||||
-- if multipath_available_state_wan == "" then
|
-- if multipath_available_state_wan == "" then
|
||||||
|
@ -1144,7 +1146,7 @@ function interfaces_status()
|
||||||
-- mArray.openmptcprouter["server_mptcp"] = "disabled"
|
-- mArray.openmptcprouter["server_mptcp"] = "disabled"
|
||||||
-- end
|
-- end
|
||||||
-- else
|
-- else
|
||||||
-- multipath_available = "ERROR"
|
multipath_available = "ERROR"
|
||||||
-- connectivity = "WARNING"
|
-- connectivity = "WARNING"
|
||||||
-- end
|
-- end
|
||||||
-- else
|
-- else
|
||||||
|
@ -1208,6 +1210,12 @@ function interfaces_status()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local rx = ""
|
||||||
|
local tx = ""
|
||||||
|
if ifname ~= "" and ifname ~= nil then
|
||||||
|
rx = ut.trim(sys.exec("devstatus " .. ifname .. " | jsonfilter -e '@.statistics.rx_bytes'"))
|
||||||
|
tx = ut.trim(sys.exec("devstatus " .. ifname .. " | jsonfilter -e '@.statistics.tx_bytes'"))
|
||||||
|
end
|
||||||
local data = {
|
local data = {
|
||||||
label = section["label"] or interface,
|
label = section["label"] or interface,
|
||||||
name = interface,
|
name = interface,
|
||||||
|
@ -1235,6 +1243,8 @@ function interfaces_status()
|
||||||
phonenumber = phonenumber,
|
phonenumber = phonenumber,
|
||||||
donglestate = donglestate,
|
donglestate = donglestate,
|
||||||
networktype = networktype,
|
networktype = networktype,
|
||||||
|
rx = rx,
|
||||||
|
tx = tx,
|
||||||
}
|
}
|
||||||
if ifname ~= nil and ifname:match("^tun.*") then
|
if ifname ~= nil and ifname:match("^tun.*") then
|
||||||
table.insert(mArray.tunnels, data);
|
table.insert(mArray.tunnels, data);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue