Skip to content

Commit

Permalink
[bot] luci-app-ssr-plus: update
Browse files Browse the repository at this point in the history
latest commit: 9028c41284e1b6e63409ec07c6d7b80b9d488a77
  • Loading branch information
github-actions[bot] authored and hathwkfg committed Aug 2, 2020
1 parent fa1d5f4 commit e53b8cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
13 changes: 6 additions & 7 deletions package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr
Original file line number Diff line number Diff line change
Expand Up @@ -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="" ;;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e53b8cf

Please sign in to comment.