14 lines
381 B
Bash
Executable File
14 lines
381 B
Bash
Executable File
#!/usr/bin/env bash
|
||
set -euo pipefail
|
||
# shellcheck disable=SC1091
|
||
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common.sh"
|
||
|
||
for name in server ui; do
|
||
pid_file="$RUNTIME_DIR/$name.pid"
|
||
if [[ -f "$pid_file" ]]; then
|
||
pid="$(cat "$pid_file")"
|
||
if kill -0 "$pid" 2>/dev/null; then kill "$pid"; echo "已停止 $name,PID $pid。"; fi
|
||
rm -f "$pid_file"
|
||
fi
|
||
done
|