This commit is contained in:
2026-01-13 10:26:20 -05:00
parent 770390ff9b
commit 47f1d1311f
2 changed files with 42 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
# Navigate to the script's directory
cd "$(dirname "$0")"
if [ -f "app.pid" ]; then
PID=$(cat app.pid)
if ps -p $PID > /dev/null; then
echo "Stopping app (PID $PID)..."
kill $PID
rm app.pid
echo "Stopped."
else
echo "PID file found ($PID) but process is not running. Removing stale PID file."
rm app.pid
fi
else
echo "No PID file found. Trying to find process by name..."
pkill -f "python3 main.py"
if [ $? -eq 0 ]; then
echo "Stopped via process name."
else
echo "No running process found."
fi
fi