mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 19:12:33 +08:00
luci-app-ssr-plus: sync with upstream source
This commit is contained in:
parent
4c8ce72b3f
commit
e8ac4178d0
@ -49,8 +49,8 @@ o = s:option(Flag, "adblock", translate("Enable adblock"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "adblock_url", translate("adblock_url"))
|
||||
o:value("https://gitee.com/privacy-protection-tools/anti-ad/raw/master/anti-ad-for-dnsmasq.conf", translate("anti-AD"))
|
||||
o.default = "https://gitee.com/privacy-protection-tools/anti-ad/raw/master/anti-ad-for-dnsmasq.conf"
|
||||
o:value("https://anti-ad.net/anti-ad-for-dnsmasq.conf", translate("anti-AD"))
|
||||
o.default = "https://anti-ad.net/anti-ad-for-dnsmasq.conf"
|
||||
o:depends("adblock", "1")
|
||||
o.description = translate("Support AdGuardHome and DNSMASQ format list")
|
||||
|
||||
|
@ -306,7 +306,8 @@ start_dns() {
|
||||
start_redir_tcp() {
|
||||
local type=$(uci_get_by_name $GLOBAL_SERVER type)
|
||||
local bin=$(find_bin $type)
|
||||
[ ! -f "$bin" ] && echo "$(date "+%Y-%m-%d %H:%M:%S") Main node:Can't find $bin program, can't start!" >>/tmp/ssrplus.log && return 1
|
||||
redir_tcp=1
|
||||
[ ! -f "$bin" ] && echo "$(date "+%Y-%m-%d %H:%M:%S") Main node:Can't find $bin program, can't start!" >>/tmp/ssrplus.log && redir_tcp=0 && return 1
|
||||
case "$(uci_get_by_name $GLOBAL_SERVER auth_enable)" in
|
||||
1 | on | true | yes | enabled) ARG_OTA="-A" ;;
|
||||
*) ARG_OTA="" ;;
|
||||
@ -374,9 +375,10 @@ start_redir_tcp() {
|
||||
|
||||
start_redir_udp() {
|
||||
if [ -n "$UDP_RELAY_SERVER" ]; then
|
||||
redir_udp=1
|
||||
local type=$(uci_get_by_name $UDP_RELAY_SERVER type)
|
||||
local bin=$(find_bin $type)
|
||||
[ ! -f "$bin" ] && echo "$(date "+%Y-%m-%d %H:%M:%S") UDP TPROXY Relay:Can't find $bin program, can't start!" >>/tmp/ssrplus.log && return 1
|
||||
[ ! -f "$bin" ] && echo "$(date "+%Y-%m-%d %H:%M:%S") UDP TPROXY Relay:Can't find $bin program, can't start!" >>/tmp/ssrplus.log && redir_udp=0 && return 1
|
||||
case "$type" in
|
||||
ss | ssr)
|
||||
case "$(uci_get_by_name $UDP_RELAY_SERVER auth_enable)" in
|
||||
@ -480,12 +482,12 @@ start_local() {
|
||||
[ "$local_server" == "same" ] && local_server=$GLOBAL_SERVER
|
||||
local type=$(uci_get_by_name $local_server type)
|
||||
local bin=$(find_bin $type)
|
||||
[ ! -f "$bin" ] && echo "$(date "+%Y-%m-%d %H:%M:%S") Global_Socks5:Can't find $bin program, can't start!" >>/tmp/ssrplus.log && return 1
|
||||
[ ! -f "$bin" ] && echo "$(date "+%Y-%m-%d %H:%M:%S") Global_Socks5:Can't find $bin program, can't start!" >>/tmp/ssrplus.log && local_enable=0 && return 1
|
||||
case "$type" in
|
||||
ss | ssr)
|
||||
local name="Shadowsocks"
|
||||
local bin=$(find_bin $type-local)
|
||||
[ ! -f "$bin" ] && echo "$(date "+%Y-%m-%d %H:%M:%S") Global_Socks5:Can't find $bin program, can't start!" >>/tmp/ssrplus.log && return 1
|
||||
[ ! -f "$bin" ] && echo "$(date "+%Y-%m-%d %H:%M:%S") Global_Socks5:Can't find $bin program, can't start!" >>/tmp/ssrplus.log && local_enable=0 && return 1
|
||||
[ "$type" == "ssr" ] && name="ShadowsocksR"
|
||||
gen_config_file $local_server 3 $(uci_get_by_type socks5_proxy local_port 1080)
|
||||
$bin -c $CONFIG_SOCK5_FILE -u -f /var/run/ssr-local.pid >/dev/null 2>&1
|
||||
@ -668,14 +670,11 @@ start_rules() {
|
||||
rules() {
|
||||
if [ "$GLOBAL_SERVER" == "nil" ]; then
|
||||
return 1
|
||||
else
|
||||
redir_tcp=1
|
||||
fi
|
||||
mkdir -p /var/run /var/etc
|
||||
run_mode=$(uci_get_by_type global run_mode)
|
||||
UDP_RELAY_SERVER=$(uci_get_by_type global udp_relay_server)
|
||||
[ "$UDP_RELAY_SERVER" == "same" ] && UDP_RELAY_SERVER=$GLOBAL_SERVER
|
||||
[ -n "$UDP_RELAY_SERVER" ] && redir_udp=1
|
||||
if start_rules; then
|
||||
return 0
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user