1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Merge branch 'test' into ipq60xx

This commit is contained in:
suyuan 2022-09-13 14:03:07 +08:00
commit e6d8fa925d
7 changed files with 41 additions and 16 deletions

View file

@ -634,6 +634,8 @@ function wizard_add()
ucic:set("unbound","ub_main","dns64","0")
end
ucic:save("unbound")
ucic:commit("unbound")
-- Get Proxy set by default
local default_proxy = luci.http.formvalue("default_proxy") or "shadowsocks"
@ -981,7 +983,7 @@ function wizard_add()
ucic:set("openvpn","omr","enabled",1)
ucic:set("network","omrvpn","proto","none")
else
ucic:set("openvpn","omr","enabled",0)
ucic:delete("openvpn","omr","enabled")
end
ucic:save("openvpn")
ucic:commit("openvpn")
@ -1156,7 +1158,7 @@ function settings_add()
ucic:set("openmptcprouter","settings","shadowsocksudp",shadowsocksudp)
-- Enable/disable v2ray udp
local shadowsocksudp = luci.http.formvalue("v2rayudp") or "1"
local v2rayudp = luci.http.formvalue("v2rayudp") or "1"
ucic:set("v2ray","main_transparent_proxy","redirect_udp",v2rayudp)
-- Enable/disable nDPI
@ -1233,16 +1235,6 @@ function settings_add()
-- Enable/disable SIP ALG
local sipalg = luci.http.formvalue("sipalg") or "0"
ucic:set("openmptcprouter","settings","sipalg",sipalg)
ucic:foreach("firewall", "zone", function (section)
ucic:set("firewall",section[".name"],"auto_helper",sipalg)
end)
if sipalg == "1" then
luci.sys.call("modprobe -q nf_conntrack_sip >/dev/null 2>/dev/null")
luci.sys.call("modprobe -q nf_nat_sip >/dev/null 2>/dev/null")
else
luci.sys.call("rmmod nf_nat_sip >/dev/null 2>/dev/null")
luci.sys.call("rmmod nf_conntrack_sip >/dev/null 2>/dev/null")
end
ucic:save("openmptcprouter")
ucic:commit("openmptcprouter")

View file

@ -181,6 +181,28 @@ start_service() {
rmmod fast_classifier 2>&1 >/dev/null
fi
if [ "$(uci -q get openmptcprouter.settings.sipalg)" = "0" ]; then
uci -q batch <<-EOF >/dev/null
set firewall.zone_lan.auto_helper='0'
set firewall.zone_wan.auto_helper='0'
set firewall.zone_vpn.auto_helper='0'
commit firewall
EOF
rmmod nf_nat_sip 2>&1 >/dev/null
sleep 2
rmmod nf_conntrack_sip 2>&1 >/dev/null
else
uci -q batch <<-EOF >/dev/null
set firewall.zone_lan.auto_helper='1'
set firewall.zone_wan.auto_helper='1'
set firewall.zone_vpn.auto_helper='1'
commit firewall
EOF
modprobe -q nf_conntrack_sip 2>&1 >/dev/null
sleep 2
modprobe -q nf_nat_sip 2>&1 >/dev/null
fi
if [ "$(uci -q get rpcd.@rpcd[0].socket)" != "/var/run/ubus/ubus.sock" ]; then
uci -q batch <<-EOF >/dev/null
set rpcd.@rpcd[0].socket='/var/run/ubus/ubus.sock'