24 lines
576 B
Bash
Executable File
24 lines
576 B
Bash
Executable File
#!/bin/bash
|
|
# Stop the Mortdecai gateway
|
|
PID_FILE="/tmp/mortdecai-gateway.pid"
|
|
|
|
if [ -f "$PID_FILE" ]; then
|
|
PID=$(cat "$PID_FILE")
|
|
if kill -0 "$PID" 2>/dev/null; then
|
|
kill "$PID"
|
|
echo "Gateway stopped (PID $PID)"
|
|
else
|
|
echo "Gateway not running (stale PID file)"
|
|
fi
|
|
rm -f "$PID_FILE"
|
|
else
|
|
# Fallback: find by process name
|
|
PID=$(pgrep -f "uvicorn gateway.api" 2>/dev/null | head -1)
|
|
if [ -n "$PID" ]; then
|
|
kill "$PID"
|
|
echo "Gateway stopped (PID $PID)"
|
|
else
|
|
echo "Gateway not running"
|
|
fi
|
|
fi
|