mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
Various small fixes
This commit is contained in:
parent
70571e546b
commit
218fb8a6e5
3 changed files with 10 additions and 3 deletions
|
@ -85,6 +85,7 @@
|
||||||
|
|
||||||
function bandwidth_label(bytes, br)
|
function bandwidth_label(bytes, br)
|
||||||
{
|
{
|
||||||
|
if (bytes < 0) bytes = 0;
|
||||||
var uby = '<%:kB/s%>';
|
var uby = '<%:kB/s%>';
|
||||||
var kby = (bytes / 1024);
|
var kby = (bytes / 1024);
|
||||||
|
|
||||||
|
|
|
@ -634,6 +634,8 @@ function wizard_add()
|
||||||
ucic:set("unbound","ub_main","dns64","0")
|
ucic:set("unbound","ub_main","dns64","0")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
ucic:save("unbound")
|
||||||
|
ucic:commit("unbound")
|
||||||
|
|
||||||
-- Get Proxy set by default
|
-- Get Proxy set by default
|
||||||
local default_proxy = luci.http.formvalue("default_proxy") or "shadowsocks"
|
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("openvpn","omr","enabled",1)
|
||||||
ucic:set("network","omrvpn","proto","none")
|
ucic:set("network","omrvpn","proto","none")
|
||||||
else
|
else
|
||||||
ucic:set("openvpn","omr","enabled",0)
|
ucic:delete("openvpn","omr","enabled")
|
||||||
end
|
end
|
||||||
ucic:save("openvpn")
|
ucic:save("openvpn")
|
||||||
ucic:commit("openvpn")
|
ucic:commit("openvpn")
|
||||||
|
@ -1156,7 +1158,7 @@ function settings_add()
|
||||||
ucic:set("openmptcprouter","settings","shadowsocksudp",shadowsocksudp)
|
ucic:set("openmptcprouter","settings","shadowsocksudp",shadowsocksudp)
|
||||||
|
|
||||||
-- Enable/disable v2ray udp
|
-- 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)
|
ucic:set("v2ray","main_transparent_proxy","redirect_udp",v2rayudp)
|
||||||
|
|
||||||
-- Enable/disable nDPI
|
-- Enable/disable nDPI
|
||||||
|
|
|
@ -1461,8 +1461,12 @@ _set_config_from_vps() {
|
||||||
uci -q batch <<-EOF >/dev/null
|
uci -q batch <<-EOF >/dev/null
|
||||||
set openvpn.omr.port=$openvpn_port
|
set openvpn.omr.port=$openvpn_port
|
||||||
set openvpn.omr.secret="/etc/luci-uploads/openvpn.key"
|
set openvpn.omr.secret="/etc/luci-uploads/openvpn.key"
|
||||||
set openvpn.omr.enabled=$openvpn_state
|
|
||||||
EOF
|
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
|
if [ "$(uci -q get openvpn.omr.remote)" != "127.0.0.1" ]; then
|
||||||
uci -q set openvpn.omr.remote="$vpsip"
|
uci -q set openvpn.omr.remote="$vpsip"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue