#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
if [[ $# -ne 1 ]]; then
  echo "Usage: bash setup_cpanel.sh https://http://bot.seikhprimegame.top//webhook" >&2
  echo "Run inside the cPanel Python application's activated virtual environment." >&2
  exit 2
fi
URL="$1"
case "$URL" in https://*) ;; *) echo "Webhook URL must use HTTPS" >&2; exit 2;; esac
python -m pip install -r requirements.txt
python self_check.py
python setup_webhook.py "$URL"
