-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathstop_canopy_web.sh
More file actions
28 lines (26 loc) · 853 Bytes
/
stop_canopy_web.sh
File metadata and controls
28 lines (26 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Stop Canopy Web UI
# Compatible with macOS and Linux
CANOPY_DIR="$(cd "$(dirname "$0")" && pwd)"
RUNTIME_DIR="$CANOPY_DIR/.canopy_runtime"
PID_FILE="$RUNTIME_DIR/canopy_web.pid"
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if kill -0 "$PID" 2>/dev/null; then
echo "Stopping Canopy Web UI (PID: $PID)..."
kill "$PID"
# Give it a moment to shut down
sleep 2
if kill -0 "$PID" 2>/dev/null; then
echo "Canopy Web UI (PID: $PID) did not stop gracefully. Force killing..."
kill -9 "$PID"
fi
rm "$PID_FILE"
echo "Canopy Web UI stopped."
else
echo "No running Canopy Web UI found with PID from $PID_FILE. Removing stale PID file."
rm "$PID_FILE"
fi
else
echo "Canopy Web UI is not running (PID file not found)."
fi