#!/bin/bash

if [ "$1" = "stop" ]; then
    pkill -f "gunicorn -w 3 -b 127.0.0.1:5005"
    exit 0
fi

cd /opt/fmhost
source venv/bin/activate
cd /opt/fmhost/app  
gunicorn -w 3 -b 127.0.0.1:5005 main:app
