#!/bin/bash # Kill any process using port 5100 echo "Checking for processes on port 5100..." pid=$(lsof -ti:5100) if [ -n "$pid" ]; then echo "Killing process $pid on port 5100" kill -9 $pid else echo "No process found on port 5100" fi # Activate virtual environment echo "Activating virtual environment..." source venv/bin/activate # Set Flask environment variables export FLASK_APP=app export FLASK_RUN_PORT=5100 # Run the Flask app echo "Starting Flask app on port 5100..." flask run --port=5100 --no-reload # This script won't reach here unless the flask app is interrupted echo "Flask app stopped"