#!/bin/bash

# Check if gunicorn service is active
if systemctl is-active --quiet gunicorn; then
    echo "Gunicorn service is already running."
else
    echo "Starting Gunicorn service..."
    systemctl start gunicorn
    sleep 2
    if systemctl is-active --quiet gunicorn; then
        echo "Gunicorn started successfully."
    else
        echo "Failed to start Gunicorn service."
        exit 1
    fi
fi

# Open the URL in the default browser
xdg-open https://knowledge.local/


