feat: detects existing clash instances before it starts one

This commit is contained in:
NekoRectifier
2023-12-12 15:19:39 +08:00
parent 725d109594
commit 5530eaf4e4
17 changed files with 9723 additions and 58 deletions

4
restart.sh Normal file → Executable file
View File

@ -36,7 +36,7 @@ if_success() {
fi
}
# 定义路变量
# 定义路变量
Server_Dir=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
Conf_Dir="$Server_Dir/conf"
Log_Dir="$Server_Dir/logs"
@ -45,7 +45,7 @@ Log_Dir="$Server_Dir/logs"
Text1="服务关闭成功!"
Text2="服务关闭失败!"
# 查询并关闭程序进程
PID_NUM=`ps -ef | grep [c]lash-linux-a | wc -l`
PID_NUM=`PID_NUM=`ps -ef | grep [c]lash-linux-a | wc -l``
PID=`ps -ef | grep [c]lash-linux-a | awk '{print $2}'`
if [ $PID_NUM -ne 0 ]; then
kill -9 $PID