-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop-daemon.sh
More file actions
42 lines (34 loc) · 1007 Bytes
/
stop-daemon.sh
File metadata and controls
42 lines (34 loc) · 1007 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Kuro Daemon Stopper Script
# Usage: ./stop-daemon.sh
echo "🛑 Stopping Kuro daemon..."
PID_FILE="$HOME/.kuro/daemon.pid"
if [ -f "$PID_FILE" ]; then
PID=$(cat "$PID_FILE")
if ps -p $PID > /dev/null 2>&1; then
echo " Found daemon with PID: $PID"
kill $PID
sleep 2
if ps -p $PID > /dev/null 2>&1; then
echo " Forcing shutdown..."
kill -9 $PID
fi
rm -f "$PID_FILE"
echo "✅ Daemon stopped"
else
echo "⚠️ PID file exists but process not running"
rm -f "$PID_FILE"
fi
else
if pgrep -f "kuro --daemon" > /dev/null 2>&1; then
echo " Found kuro daemon process"
pkill -f "kuro --daemon"
echo "✅ Daemon stopped"
elif pgrep -f "bun.*--daemon" > /dev/null 2>&1; then
echo " Found bun daemon process"
pkill -f "bun.*--daemon"
echo "✅ Daemon stopped"
else
echo "ℹ️ No daemon running"
fi
fi