#!/bin/bash # Stop Aniworld FastAPI Server echo "Stopping Aniworld server..." # Method 1: Kill uvicorn processes pkill -f "uvicorn.*fastapi_app:app" && echo "✓ Stopped uvicorn processes" # Method 2: Kill any process using port 8000 PORT_PID=$(lsof -ti:8000) if [ -n "$PORT_PID" ]; then kill -9 $PORT_PID echo "✓ Killed process on port 8000 (PID: $PORT_PID)" else echo "✓ Port 8000 is already free" fi # Method 3: Kill any python processes running the server pkill -f "run_server.py" && echo "✓ Stopped run_server.py processes" echo "" echo "Server stopped successfully!" echo "You can restart it with: ./start_server.sh"