Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
check port
Browse files Browse the repository at this point in the history
  • Loading branch information
ChisBread committed May 8, 2022
1 parent 2043ba7 commit b3d282f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ su - clash -c '/usr/bin/clash -d /etc/clash -ext-ctl '"0.0.0.0:$DASH_PORT"' -ext
EXPID=$!
while :
do
set +e
PID=`ps -def|grep -P '^clash'|awk '{print $2}'`
if [ "$PID" == "" ]; then
PORT_EXIST=`ss -tlnp| awk '{print $4}'|grep -P ".*:$CLASH_TPROXY_PORT"`
set -e
if [ "$PID" == "" ] || [ "$PORT_EXIST" == "" ]; then
EXPID_EXIST=$(ps aux | awk '{print $2}'| grep -w $EXPID)
if [ ! $EXPID_EXIST ];then
cat /etc/clash/clash.log
Expand Down

0 comments on commit b3d282f

Please sign in to comment.