Spaces:
Running
Running
Download stop.sh from sathvik77/MusicUtils: direct link, hf CLI and curl.
- Browser
- Download file 647 Bytes
-
https://huggingface.co/spaces/sathvik77/MusicUtils/resolve/main/stop.sh
- Command line
-
hf download hf://spaces/sathvik77/MusicUtils/stop.sh
-
curl -L -o stop.sh https://huggingface.co/spaces/sathvik77/MusicUtils/resolve/main/stop.sh
647 Bytes
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| PID_FILE="$SCRIPT_DIR/.backend.pid" | |
| if [ -f "$PID_FILE" ]; then | |
| PID=$(cat "$PID_FILE") | |
| if kill -0 "$PID" 2>/dev/null; then | |
| kill "$PID" | |
| rm "$PID_FILE" | |
| echo "Backend stopped (PID $PID)" | |
| else | |
| echo "No process found for PID $PID, cleaning up stale pid file" | |
| rm "$PID_FILE" | |
| fi | |
| else | |
| # Fallback: kill by process name | |
| PIDS=$(pgrep -f "uvicorn main:app") | |
| if [ -n "$PIDS" ]; then | |
| echo "$PIDS" | xargs kill | |
| echo "Backend stopped (PIDs: $PIDS)" | |
| else | |
| echo "Backend is not running" | |
| fi | |
| fi | |