Files
syscall_monitor/stop.sh
MarceloZoeng 26a5f99587
All checks were successful
CI / lint-and-build (push) Successful in 8s
中文+README
2026-06-14 12:08:27 +08:00

15 lines
269 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
cd "$(dirname "$0")"
if [ -f .pid ]; then
PID=$(cat .pid)
if kill -0 "$PID" 2>/dev/null; then
kill "$PID"
echo "已停止pid=$PID"
else
echo "pid $PID 进程未在运行"
fi
rm -f .pid
else
echo "未找到 .pid 文件"
fi