-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcleanup_tts_server.sh
More file actions
executable file
·27 lines (24 loc) · 825 Bytes
/
cleanup_tts_server.sh
File metadata and controls
executable file
·27 lines (24 loc) · 825 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
#!/bin/bash
# Check if there's a TTS server running on port 8000
TTS_PID=$(lsof -Pi :8000 -sTCP:LISTEN -t 2>/dev/null)
if [ -n "$TTS_PID" ]; then
echo "Found TTS server running on port 8000 (PID: $TTS_PID)"
echo "Shutting down TTS server..."
kill $TTS_PID
sleep 1
# Verify it's gone
if ! lsof -Pi :8000 -sTCP:LISTEN -t >/dev/null; then
echo "TTS server successfully shut down."
else
echo "TTS server is still running, trying force kill..."
kill -9 $TTS_PID
sleep 1
if ! lsof -Pi :8000 -sTCP:LISTEN -t >/dev/null; then
echo "TTS server successfully force killed."
else
echo "ERROR: Failed to kill TTS server. Please check process manually."
fi
fi
else
echo "No TTS server found running on port 8000."
fi