From 072ed9f80c43e5defb3668cb3f751e0c801fd380 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Sun, 13 Oct 2019 22:17:10 -0700 Subject: [PATCH 1/9] luci-app-ssr-plus: compatible with proc-ng-ps --- package/lean/luci-app-ssr-plus/Makefile | 2 +- .../luasrc/controller/shadowsocksr.lua | 2 +- .../luci-app-ssr-plus/root/etc/init.d/shadowsocksr | 6 +++--- .../luci-app-ssr-plus/root/usr/bin/ssr-monitor | 14 +++++++------- .../lean/luci-app-ssr-plus/root/usr/bin/ssr-switch | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index b5231681b1..1a8bcb8b37 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:=1 -PKG_RELEASE:=105 +PKG_RELEASE:=106 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \ diff --git a/package/lean/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua b/package/lean/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua index f819c74f8c..524bf67d3b 100644 --- a/package/lean/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua +++ b/package/lean/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua @@ -41,7 +41,7 @@ end function act_status() local e={} - e.running=luci.sys.call("ps -w | grep ssr-retcp | grep -v grep >/dev/null")==0 + e.running=luci.sys.call("busybox ps -w | grep ssr-retcp | grep -v grep >/dev/null")==0 luci.http.prepare_content("application/json") luci.http.write_json(e) end 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 43b50b47b6..1f6cbec8dc 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 @@ -527,10 +527,10 @@ stop() { iptables -X SSR-SERVER-RULE 2>/dev/null fi if [ -z "$switch_server" ] ;then - kill -9 $(ps | grep ssr-switch | grep -v grep | awk '{print $1}') >/dev/null 2>&1 + kill -9 $(busybox ps -w | grep ssr-switch | grep -v grep | awk '{print $1}') >/dev/null 2>&1 fi if [ $(uci_get_by_type global monitor_enable) = 1 ] ;then - kill -9 $(ps | grep ssr-monitor | grep -v grep | awk '{print $1}') >/dev/null 2>&1 + kill -9 $(busybox ps -w | grep ssr-monitor | grep -v grep | awk '{print $1}') >/dev/null 2>&1 fi killall -q -9 ssr-monitor killall -q -9 ss-redir @@ -542,7 +542,7 @@ stop() { if [ -f /var/run/pdnsd.pid ] ;then kill $(cat /var/run/pdnsd.pid) >/dev/null 2>&1 else - kill -9 $(ps | grep pdnsd | grep -v grep | awk '{print $1}') >/dev/null 2>&1 + kill -9 $(busybox ps -w | grep pdnsd | grep -v grep | awk '{print $1}') >/dev/null 2>&1 fi if [ -f "/tmp/dnsmasq.d/dnsmasq-ssr.conf" ]; then diff --git a/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-monitor b/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-monitor index 60c34ee556..abf077f578 100755 --- a/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-monitor +++ b/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-monitor @@ -54,7 +54,7 @@ do sleep 30 #redir tcp if [ $redir_tcp_process -gt 0 ] ;then - icount=`ps -w | grep ssr-retcp |grep -v grep| wc -l` + icount=`busybox ps -w | grep ssr-retcp |grep -v grep| wc -l` if [ $icount = 0 ] ;then logger -t "$NAME" "ssr redir tcp error.restart!" /etc/init.d/shadowsocksr restart @@ -63,7 +63,7 @@ do fi #redir udp if [ $redir_udp_process -gt 0 ] ;then - icount=`ps -w | grep ssr-reudp|grep -v grep| wc -l` + icount=`busybox ps -w | grep ssr-reudp|grep -v grep| wc -l` if [ $icount = 0 ] ;then logger -t "$NAME" "ssr redir udp error.restart!" /etc/init.d/shadowsocksr restart @@ -72,7 +72,7 @@ do fi #tunnel if [ $tunnel_process -gt 0 ] ;then - icount=`ps -w | grep ssr-tunnel |grep -v grep| wc -l` + icount=`busybox ps -w | grep ssr-tunnel |grep -v grep| wc -l` if [ $icount = 0 ] ;then logger -t "$NAME" "ssr tunnel error.restart!" /etc/init.d/shadowsocksr restart @@ -81,7 +81,7 @@ do fi #server if [ $server_process_count -gt 0 ] ;then - icount=`ps -w | grep ssr-server |grep -v grep| wc -l` + icount=`busybox ps -w | grep ssr-server |grep -v grep| wc -l` if [ $icount -lt $server_process_count ] #如果进程挂掉就重启它 then logger -t "$NAME" "ssr server error.restart!" @@ -94,7 +94,7 @@ do fi #kcptun if [ $kcp_process -gt 0 ] ;then - icount=`ps -w | grep kcptun-client |grep -v grep| wc -l` + icount=`busybox ps -w | grep kcptun-client |grep -v grep| wc -l` if [ $icount -lt $kcp_process ] #如果进程挂掉就重启它 then logger -t "$NAME" "ssr kcptun error.restart!" @@ -105,7 +105,7 @@ do fi #local if [ $local_process -gt 0 ] ;then - icount=`ps -w | grep ssr-local |grep -v grep| wc -l` + icount=`busybox ps -w | grep ssr-local |grep -v grep| wc -l` if [ $icount -lt $local_process ] #如果进程挂掉就重启它 then logger -t "$NAME" "ssr local error.restart!" @@ -116,7 +116,7 @@ do fi #pdnsd if [ $pdnsd_process -gt 0 ] ;then - icount=`ps -w | grep pdnsd |grep -v grep| wc -l` + icount=`busybox ps -w | grep pdnsd |grep -v grep| wc -l` if [ $icount -lt $pdnsd_process ] #如果进程挂掉就重启它 then logger -t "$NAME" "pdnsd tunnel error.restart!" diff --git a/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-switch b/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-switch index 281d0f851e..9be20f019f 100755 --- a/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-switch +++ b/package/lean/luci-app-ssr-plus/root/usr/bin/ssr-switch @@ -135,7 +135,7 @@ do #缂虹渷鏈嶅姟鍣ㄦ甯革紝鍒囨崲鍥炴潵 CURRENT_SERVER=$DEFAULT_SERVER switch_proxy $CURRENT_SERVER - echo "switch to default ["$(uci_get_by_name $CURRENT_SERVER server)"] proxy!" >> /tmp/ssrplus.log + echo "$(date "+%Y-%m-%d %H:%M:%S") switch to default ["$(uci_get_by_name $CURRENT_SERVER server)"] proxy!" >> /tmp/ssrplus.log continue else echo "$(date "+%Y-%m-%d %H:%M:%S") Main server is NOT avilable.Continue using current server." >> /tmp/ssrplus.log From f9df6c9eb34e434a4285c95fa7c4e34bb3bbd6f5 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Sun, 13 Oct 2019 22:38:15 -0700 Subject: [PATCH 2/9] luci-app-unblockmusic: compatible with proc-ng-ps --- package/lean/luci-app-unblockmusic/Makefile | 2 +- .../luasrc/controller/unblockmusic.lua | 2 +- .../lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/lean/luci-app-unblockmusic/Makefile b/package/lean/luci-app-unblockmusic/Makefile index 871cf76a22..444c83402b 100644 --- a/package/lean/luci-app-unblockmusic/Makefile +++ b/package/lean/luci-app-unblockmusic/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-unblockmusic PKG_VERSION:=2.2.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=Apache-2.0 diff --git a/package/lean/luci-app-unblockmusic/luasrc/controller/unblockmusic.lua b/package/lean/luci-app-unblockmusic/luasrc/controller/unblockmusic.lua index 8cc7024d8a..231f0bf212 100644 --- a/package/lean/luci-app-unblockmusic/luasrc/controller/unblockmusic.lua +++ b/package/lean/luci-app-unblockmusic/luasrc/controller/unblockmusic.lua @@ -16,7 +16,7 @@ end function act_status() local e={} - e.running=luci.sys.call("ps | grep app.js | grep -v grep >/dev/null")==0 + e.running=luci.sys.call("busybox ps -w | grep app.js | grep -v grep >/dev/null")==0 luci.http.prepare_content("application/json") luci.http.write_json(e) end diff --git a/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic b/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic index d1cd4d8346..f9659e1d6b 100755 --- a/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic +++ b/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic @@ -69,9 +69,9 @@ start() stop() { - kill -9 $(ps | grep monitor | grep -v grep | awk '{print $1}') >/dev/null 2>&1 - kill -9 $(ps | grep app.js | grep -v grep | awk '{print $1}') >/dev/null 2>&1 - kill -9 $(ps | grep logcheck.sh | grep -v grep | awk '{print $1}') >/dev/null 2>&1 + kill -9 $(busybox ps -w | grep monitor | grep -v grep | awk '{print $1}') >/dev/null 2>&1 + kill -9 $(busybox ps -w | grep app.js | grep -v grep | awk '{print $1}') >/dev/null 2>&1 + kill -9 $(busybox ps -w | grep logcheck.sh | grep -v grep | awk '{print $1}') >/dev/null 2>&1 rm -f /tmp/unblockmusic.log del_rule From 320cb1537b59421915ca0dbcf66502c33fcc2d87 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Sun, 13 Oct 2019 22:45:42 -0700 Subject: [PATCH 3/9] luci-app-ssr-plus: status page compatible with proc-ng-ps --- package/lean/luci-app-ssr-plus/Makefile | 2 +- .../luasrc/model/cbi/shadowsocksr/status.lua | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index 1a8bcb8b37..80809539b3 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:=1 -PKG_RELEASE:=106 +PKG_RELEASE:=107 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \ 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 c8b8200fa1..9163c742f0 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 @@ -55,18 +55,18 @@ if nixio.fs.access("/etc/china_ssr.txt") then ip_count = sys.exec("cat /etc/china_ssr.txt | wc -l") end -local icount=sys.exec("ps -w | grep ssr-reudp |grep -v grep| wc -l") +local icount=sys.exec("busybox ps -w | grep ssr-reudp |grep -v grep| wc -l") if tonumber(icount)>0 then reudp_run=1 else -icount=sys.exec("ps -w | grep ssr-retcp |grep \"\\-u\"|grep -v grep| wc -l") +icount=sys.exec("busybox ps -w | grep ssr-retcp |grep \"\\-u\"|grep -v grep| wc -l") if tonumber(icount)>0 then reudp_run=1 end end -if luci.sys.call("ps -w | grep ssr-retcp | grep -v grep >/dev/null") == 0 then +if luci.sys.call("busybox ps -w | grep ssr-retcp | grep -v grep >/dev/null") == 0 then redir_run=1 end @@ -82,7 +82,7 @@ if luci.sys.call("pidof ssr-server >/dev/null") == 0 then server_run=1 end -if luci.sys.call("ps -w | grep ssr-tunnel |grep -v grep >/dev/null") == 0 then +if luci.sys.call("busybox ps -w | grep ssr-tunnel |grep -v grep >/dev/null") == 0 then tunnel_run=1 end From fe61dee4805b1dafa9ad8102b16d9a036230685d Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Sun, 13 Oct 2019 23:06:59 -0700 Subject: [PATCH 4/9] luci-app-ssr-plus: compatible with OpenWrt 19.07 luci --- package/lean/luci-app-ssr-plus/Makefile | 2 +- .../luasrc/model/cbi/shadowsocksr/client-config.lua | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index 80809539b3..b8e3d2f149 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:=1 -PKG_RELEASE:=107 +PKG_RELEASE:=108 PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \ diff --git a/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua b/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua index f6862054a3..9157079f6b 100644 --- a/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua +++ b/package/lean/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua @@ -4,7 +4,6 @@ local m, s, o,kcp_enable local shadowsocksr = "shadowsocksr" local uci = luci.model.uci.cursor() -local ipkg = require("luci.model.ipkg") local fs = require "nixio.fs" local sys = require "luci.sys" local sid = arg[1] From 3f76dc7b0a940b24406220132c4557090162a893 Mon Sep 17 00:00:00 2001 From: Mu Date: Mon, 14 Oct 2019 06:26:38 +0000 Subject: [PATCH 5/9] lucci-ssr-plus: Make it more like a normal browser to avoid block by waf Make it more like a normal browser to avoid block by waf. --- .../root/usr/share/shadowsocksr/subscribe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.sh b/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.sh index 6ac56c4401..1211740281 100755 --- a/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.sh +++ b/package/lean/luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.sh @@ -69,7 +69,7 @@ do echo_date "浠 ${subscribe_url[o]} 鑾峰彇璁㈤槄" echo_date "寮濮嬫洿鏂板湪绾胯闃呭垪琛..." echo_date "寮濮嬩笅杞借闃呴摼鎺ュ埌鏈湴涓存椂鏂囦欢锛岃绋嶇瓑..." - subscribe_data=$(wget-ssl --user-agent="User-Agent: Mozilla" --no-check-certificate -T 3 -O- ${subscribe_url[o]}) + subscribe_data=$(wget-ssl --user-agent="User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" --no-check-certificate -T 3 -O- ${subscribe_url[o]}) curl_code=$? # 璁$畻group鐨刪ashkey ssr_grouphashkey=$(echo "${subscribe_url[o]}" | md5sum | cut -d ' ' -f1) @@ -249,4 +249,4 @@ do logger -st $log_name[$$] -p3 "${subscribe_url[$o]} 璁㈤槄鏁版嵁鑾峰彇澶辫触 閿欒浠g爜: $curl_code" fi done -/etc/init.d/$name restart >/dev/null 2>&1 \ No newline at end of file +/etc/init.d/$name restart >/dev/null 2>&1 From 6d7336e59eef1b1f1732324050566635c1bf8895 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Sun, 13 Oct 2019 23:32:00 -0700 Subject: [PATCH 6/9] luci theme: speedup loading page --- package/lean/luci-theme-argon/Makefile | 2 +- .../lean/luci-theme-argon/luasrc/view/themes/argon/header.htm | 2 +- .../luci-theme-netgear/luasrc/view/themes/netgear/header.htm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/lean/luci-theme-argon/Makefile b/package/lean/luci-theme-argon/Makefile index 1856552d0d..9a7cafaf6e 100644 --- a/package/lean/luci-theme-argon/Makefile +++ b/package/lean/luci-theme-argon/Makefile @@ -10,7 +10,7 @@ LUCI_TITLE:=Argon Theme LUCI_DEPENDS:= LUCI_PKGARCH:=all PKG_VERSION:=1.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-theme-argon/luasrc/view/themes/argon/header.htm b/package/lean/luci-theme-argon/luasrc/view/themes/argon/header.htm index 4b6ac804fd..060e51cfc7 100644 --- a/package/lean/luci-theme-argon/luasrc/view/themes/argon/header.htm +++ b/package/lean/luci-theme-argon/luasrc/view/themes/argon/header.htm @@ -229,7 +229,7 @@
-
Loading...
+
<% render_topmenu() %>
diff --git a/package/lean/luci-theme-netgear/luasrc/view/themes/netgear/header.htm b/package/lean/luci-theme-netgear/luasrc/view/themes/netgear/header.htm index d51862ceeb..9610187264 100755 --- a/package/lean/luci-theme-netgear/luasrc/view/themes/netgear/header.htm +++ b/package/lean/luci-theme-netgear/luasrc/view/themes/netgear/header.htm @@ -192,7 +192,7 @@
-
Loading...
+