luci-app-ssr-plus: compatible with proc-ng-ps

This commit is contained in:
LEAN-ESX 2019-10-13 22:17:10 -07:00
parent 609a241000
commit 072ed9f80c
5 changed files with 13 additions and 13 deletions

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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!"

View File

@ -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