From 93b67234dbe4021ef8301d0e4ffc8e834a8650e5 Mon Sep 17 00:00:00 2001 From: coolsd Date: Sat, 21 Sep 2024 23:57:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20docker.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker.sh b/docker.sh index 9690ee5..904cdb9 100644 --- a/docker.sh +++ b/docker.sh @@ -9,6 +9,12 @@ if [ "$EUID" -ne 0 ]; then exit 1 fi +# 停止正在运行的 KHDN 进程 +if pgrep -f "$KHDN_PROCESS" > /dev/null; then + echo "Stopping existing KHDN process..." + pkill -f "$KHDN_PROCESS" +fi + # 设置变量 SERVICE_NAME="khdn" EXECUTABLE_PATH="/usr/local/bin/khdn"