From b97c4e8bb5707c90ba83885e115ba362c418d9b8 Mon Sep 17 00:00:00 2001 From: Mattraks <16359027+Mattraks@users.noreply.github.com> Date: Mon, 13 Apr 2020 01:44:03 +0800 Subject: [PATCH] luci-app-ssr-plus:Fix SS running status (#4289) * luci-app-ssr-plus:Code optimization and Fix Bug * luci-app-ssr-plus:Adjust reference data location * luci-app-ssr-plus:revert subscribe.lua * luci-app-ssr-plus:Fix SS running status * luci-app-ssr-plus:Updated version * luci-app-ssr-plus:Revised interpretation --- package/lean/luci-app-ssr-plus/Makefile | 2 +- .../luasrc/model/cbi/shadowsocksr/status.lua | 6 +++--- .../luci-app-ssr-plus/root/etc/init.d/shadowsocksr | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index 19fe30e56..313b2dae5 100644 --- a/package/lean/luci-app-ssr-plus/Makefile +++ b/package/lean/luci-app-ssr-plus/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ssr-plus PKG_VERSION:=176 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) diff --git a/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/status.lua b/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/status.lua index d6edefeb1..c8225f3eb 100644 --- a/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/status.lua +++ b/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/status.lua @@ -79,9 +79,9 @@ if luci.sys.call("busybox ps -w | grep ssr-server | grep -v grep >/dev/null") == server_run=1 end -if luci.sys.call("busybox ps -w | grep ssr-tunnel |grep -v grep >/dev/null") == 0 then - tunnel_run=1 -end +-- if luci.sys.call("busybox ps -w | grep ssr-tunnel |grep -v grep >/dev/null") == 0 then +-- tunnel_run=1 +-- end if luci.sys.call("pidof pdnsd >/dev/null") == 0 or (luci.sys.call("busybox ps -w | grep ssr-dns |grep -v grep >/dev/null") == 0 and luci.sys.call("pidof dns2socks >/dev/null") == 0)then pdnsd_run=1 diff --git a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index 0f6332eed..48910f018 100755 --- a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -337,7 +337,7 @@ start_redir_tcp() { local name="Shadowsocks" [ "$type" == "ssr" ] && name="ShadowsocksR" for i in $(seq 1 $threads); do - $bin -c $CONFIG_FILE $ARG_OTA -f /var/run/$type-retcp_$i.pid >/dev/null 2>&1 + $bin -c $CONFIG_FILE $ARG_OTA -f /var/run/ssr-retcp_$i.pid >/dev/null 2>&1 done echo "$(date "+%Y-%m-%d %H:%M:%S") Master node:$name $threads Threads Started!" >>/tmp/ssrplus.log ;; @@ -386,7 +386,7 @@ start_redir_udp() { [ "$type" == "ssr" ] && name="ShadowsocksR" gen_config_file $UDP_RELAY_SERVER 1 $(uci_get_by_name $UDP_RELAY_SERVER local_port 1234) last_config_file=$CONFIG_UDP_FILE - $bin -c $last_config_file $ARG_OTA -U -f /var/run/$type-reudp.pid >/dev/null 2>&1 + $bin -c $last_config_file $ARG_OTA -U -f /var/run/ssr-reudp.pid >/dev/null 2>&1 echo "$(date "+%Y-%m-%d %H:%M:%S") UDP TPROXY Relay:$name Started!" >>/tmp/ssrplus.log ;; v2ray) @@ -418,7 +418,7 @@ start_redir_udp() { return 0 } -start_Bypass() { +start_shunt() { if [ "$NETFLIX_SERVER" != "nil" ] && [ "$NETFLIX_SERVER" != "$GLOBAL_SERVER" ]; then local type=$(uci_get_by_name $NETFLIX_SERVER type) local bin=$(find_bin $type) @@ -431,8 +431,8 @@ start_Bypass() { [ "$type" == "ssr" ] && name="ShadowsocksR" gen_config_file $NETFLIX_SERVER 2 4321 gen_config_file $NETFLIX_SERVER 3 1088 - $bin -c /var/etc/shadowsocksr_n.json $ARG_OTA -f /var/run/$type-netflix.pid >/dev/null 2>&1 - $bin2 -c /var/etc/shadowsocksr_s.json $ARG_OTA -f /var/run/$type-socksdns.pid >/dev/null 2>&1 + $bin -c /var/etc/shadowsocksr_n.json $ARG_OTA -f /var/run/ssr-netflix.pid >/dev/null 2>&1 + $bin2 -c /var/etc/shadowsocksr_s.json $ARG_OTA -f /var/run/ssr-socksdns.pid >/dev/null 2>&1 dns2socks 127.0.0.1:1088 8.8.8.8:53 127.0.0.1:5555 -q >/dev/null 2>&1 & echo "$(date "+%Y-%m-%d %H:%M:%S") Netflix Bypass:$name Started!" >>/tmp/ssrplus.log ;; @@ -487,7 +487,7 @@ start_local() { [ ! -f "$bin" ] && echo "$(date "+%Y-%m-%d %H:%M:%S") Can't find $bin program, can't start!" >>/tmp/ssrplus.log && 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/$type-local.pid >/dev/null 2>&1 + $bin -c $CONFIG_SOCK5_FILE -u -f /var/run/ssr-local.pid >/dev/null 2>&1 echo "$(date "+%Y-%m-%d %H:%M:%S") Global_Socks5:$name Started!" >>/tmp/ssrplus.log ;; v2ray) @@ -694,7 +694,7 @@ start() { if rules; then if start_redir_tcp; then start_redir_udp - start_Bypass + start_shunt start_switch start_dns add_cron