Skip to content

Commit

Permalink
update start_all_service.sh
Browse files Browse the repository at this point in the history
fix often restart ss-redir if not use v2ray plugin
  • Loading branch information
hunterlau2020 authored Mar 14, 2020
1 parent 7dced97 commit 498f550
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/start_all_services.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/ash

SS_MERLIN_HOME=/opt/share/ss-merlin
SHADOW_CONFIG_FILE=${SS_MERLIN_HOME}/etc/shadowsocks/config.json
use_v2ray=0
if [[ -f ${SHADOW_CONFIG_FILE} ]]; then
use_v2ray=$(grep -w "plugin" ${SHADOW_CONFIG_FILE}|grep "v2ray" -c)
fi

# Start if process not running
ss_pid=$(pidof ss-redir)
Expand All @@ -13,8 +18,10 @@ fi

v2ray_pid=$(pidof v2ray-plugin)
if [[ -z "$v2ray_pid" ]]; then
killall ss-redir 2>/dev/null
ss-redir -c ${SS_MERLIN_HOME}/etc/shadowsocks/config.json -f /opt/var/run/ss-redir.pid
if [ $use_v2ray -ge 1 ];then
killall ss-redir 2>/dev/null
ss-redir -c ${SS_MERLIN_HOME}/etc/shadowsocks/config.json -f /opt/var/run/ss-redir.pid
fi
fi

unbound_pid=$(pidof unbound)
Expand Down

0 comments on commit 498f550

Please sign in to comment.