Spaces:
Running
Running
| # This script finds and stops the running Python web server. | |
| # Find the Process ID (PID) of the server script | |
| PID=$(pgrep -f 'server/server.py') | |
| # Check if a PID was found | |
| if [ -z "$PID" ]; then | |
| echo "Server is not currently running." | |
| else | |
| # Kill the process and print a confirmation | |
| kill $PID | |
| echo "Server with PID $PID has been stopped." | |
| fi | |