-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathkill_wormhole.sh
More file actions
50 lines (44 loc) · 1.36 KB
/
Copy pathkill_wormhole.sh
File metadata and controls
50 lines (44 loc) · 1.36 KB
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
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
# ============================================================
# WORMHOLE KILLER — macOS / Linux
# Finds and terminates any orphaned wormhole_server.py processes
# ============================================================
echo ""
echo " ========================================"
echo " SHADOWBROKER WORMHOLE CLEANUP (Unix)"
echo " ========================================"
echo ""
FOUND=0
# Kill any python process running wormhole_server.py
PIDS=$(pgrep -f "wormhole_server\.py" 2>/dev/null)
if [ -n "$PIDS" ]; then
for PID in $PIDS; do
echo " [KILL] Terminating wormhole process PID: $PID"
kill -TERM "$PID" 2>/dev/null
FOUND=1
done
# Give them a moment, then force-kill any survivors
sleep 2
for PID in $PIDS; do
if kill -0 "$PID" 2>/dev/null; then
echo " [FORCE] Force-killing PID: $PID"
kill -9 "$PID" 2>/dev/null
fi
done
fi
# Also check port 8787 for anything lingering
PORT_PID=$(lsof -ti :8787 2>/dev/null)
if [ -n "$PORT_PID" ]; then
for PID in $PORT_PID; do
echo " [KILL] Terminating process on port 8787, PID: $PID"
kill -TERM "$PID" 2>/dev/null
FOUND=1
done
fi
if [ "$FOUND" -eq 0 ]; then
echo " [OK] No orphaned wormhole processes found."
else
echo ""
echo " [DONE] All wormhole processes terminated."
fi
echo ""