Skip to content
Snippets Groups Projects
Commit 60a41f87 authored by Menezes, Luke J (PG/T - Comp Sci & Elec Eng)'s avatar Menezes, Luke J (PG/T - Comp Sci & Elec Eng)
Browse files

Upload New File

parent 37097377
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# Find the PID of the Flask application using lsof
FLASK_PID=$(lsof -t -i :8080)
if [ -z "$FLASK_PID" ]; then
echo "Flask application is not running on port 8080"
else
# Terminate the Flask application
kill $FLASK_PID
# Wait for a moment to ensure the process has been terminated
sleep 2
# Check if the process is still running
if lsof -i :8080 > /dev/null; then
echo "Failed to terminate Flask application, forcing termination"
kill -9 $FLASK_PID
else
echo "Flask application terminated successfully"
fi
fi
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment