#!/bin/bash

while true; do
    if ! pgrep -f "python manage.py start_monitor" > /dev/null; then
        echo "Process crashed, restarting..."
        cd /var/www/selltix/SellTix/Backend
        source venv/bin/activate
	python manage.py start_monitor > monitor.log 2>&1 &
    fi
    sleep 60
done

