first commit
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
# shellcheck source=scripts/local-debug-env.sh
|
||||
source "$ROOT_DIR/scripts/local-debug-env.sh"
|
||||
|
||||
if [[ ! -d "$LOCAL_DEBUG_PID_DIR" ]]; then
|
||||
printf 'no local debug pid directory at %s\n' "$LOCAL_DEBUG_PID_DIR"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for name in platform_web run platform; do
|
||||
pid_file="$LOCAL_DEBUG_PID_DIR/$name.pid"
|
||||
if [[ ! -f "$pid_file" ]]; then
|
||||
continue
|
||||
fi
|
||||
pid="$(cat "$pid_file")"
|
||||
if kill -0 "$pid" 2>/dev/null; then
|
||||
printf 'stopping %s pid %s\n' "$name" "$pid"
|
||||
kill "$pid" 2>/dev/null || true
|
||||
else
|
||||
printf '%s pid %s is not running\n' "$name" "$pid"
|
||||
fi
|
||||
rm -f "$pid_file"
|
||||
done
|
||||
Reference in New Issue
Block a user