19 lines
628 B
Bash
19 lines
628 B
Bash
#!/usr/bin/env bash
|
|||
|
|
# 清理本地验证进程(脚本化避免 pkill -f 自匹配问题)
|
||
|
|
set -u
|
||
|
|
for pat in "target/debug/examples/demo" ".venv/bin/worker_serve" "scripts/zenoh_router.py" ".venv/bin/serve" "target/debug/gen_models"; do
|
||
|
|
pids=$(pgrep -f "$pat" || true)
|
||
|
|
if [ -n "$pids" ]; then
|
||
|
|
kill $pids 2>/dev/null
|
||
|
|
echo "killed [$pat]: $(echo $pids | tr '\n' ' ')"
|
||
|
|
fi
|
||
|
|
done
|
||
|
|
sleep 1
|
||
|
|
remaining=$(pgrep -f "target/debug/examples/demo|worker_serve|zenoh_router|\.venv/bin/serve" || true)
|
||
|
|
if [ -n "$remaining" ]; then
|
||
|
|
echo "WARN 仍存活: $remaining"
|
||
|
|
kill -9 $remaining 2>/dev/null
|
||
|
|
else
|
||
|
|
echo "清理完成"
|
||
|
|
fi
|