backend/restart_api.sh

9 lines
358 B
Bash
Executable file

#!/bin/bash
# Restart danagble API safely: pattern lives in this file, never in the caller cmdline.
pkill -f 'uvicorn src\.main:app' 2>/dev/null
sleep 2
cd /home/hailt/danagble/backend
setsid -f .venv/bin/python -m uvicorn src.main:app --host 0.0.0.0 --port 8000 </dev/null >>/tmp/danagble-api.log 2>&1
sleep 4
curl -s -m 5 localhost:8000/api/v1/health
echo