1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-14 11:31:51 +00:00

Various small fixes

This commit is contained in:
Ycarus (Yannick Chabanois) 2022-09-12 19:55:17 +02:00
parent 70571e546b
commit 218fb8a6e5
3 changed files with 10 additions and 3 deletions

View file

@ -85,6 +85,7 @@
function bandwidth_label(bytes, br)
{
if (bytes < 0) bytes = 0;
var uby = '<%:kB/s%>';
var kby = (bytes / 1024);

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

View file

@ -1461,8 +1461,12 @@ _set_config_from_vps() {
uci -q batch <<-EOF >/dev/null
set openvpn.omr.port=$openvpn_port
set openvpn.omr.secret="/etc/luci-uploads/openvpn.key"
set openvpn.omr.enabled=$openvpn_state
EOF
if [ "$openvpn_state" = "1" ]; then
uci -q set openvpn.omr.enabled=$openvpn_state
else
uci -q del openvpn.omr.enabled
fi
if [ "$(uci -q get openvpn.omr.remote)" != "127.0.0.1" ]; then
uci -q set openvpn.omr.remote="$vpsip"
fi