From 6033e2374761b28270938c9b1a66e755146ad4a0 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Thu, 26 Mar 2026 08:32:53 +0800 Subject: [PATCH] auto-sync: 2026-03-26 08:32:53 --- management/sanguo_auto_sync/stop-watcher.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/management/sanguo_auto_sync/stop-watcher.sh b/management/sanguo_auto_sync/stop-watcher.sh index 9cbbca888..c4645cccd 100755 --- a/management/sanguo_auto_sync/stop-watcher.sh +++ b/management/sanguo_auto_sync/stop-watcher.sh @@ -3,19 +3,21 @@ # 停止文件监控器 # ============================================ -if [ ! -f "../watcher.pid" ]; then +cd "$(dirname "$0")" + +if [ ! -f "watcher.pid" ]; then echo "✓ No PID file found, watcher not running" exit 0 fi -PID=$(cat "../watcher.pid") +PID=$(cat "watcher.pid") if kill -0 $PID 2>/dev/null; then echo "✓ Stopping file watcher (PID $PID)" kill $PID - rm -f "../watcher.pid" + rm -f "watcher.pid" echo "✓ Stopped" else echo "✓ Process $PID not running, removing PID file" - rm -f "../watcher.pid" + rm -f "watcher.pid" fi