elder-yudao-pro/deploy/local/stop.sh

14 lines
388 B
Bash
Executable File
Raw 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
set -euo pipefail
# shellcheck disable=SC1091
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common.sh"
for name in server ui mobile; 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