#!/bin/bash

source /opt/scripts_local/shared_functions.sh

MY_CRED="username=admin&password=Vocalize_Void_Rage_Visor_Ladies_Undercook_Spokesman_Fraternal"
MY_HEADER="Referer: https://qbt.noxs.me"
MY_COOKIE=$(curl -i --header "$MY_HEADER" --data "$MY_CRED" https://qbt.noxs.me/api/v2/auth/login | grep SID= | cut -d ';' -f 1 | cut -d ' ' -f 2)
if ! _isVarEmpty "$MY_COOKIE"; then
  if ( curl https://qbt.noxs.me/api/v2/app/version --cookie "$MY_COOKIE" ) ; then
    exit 0
  else
    exit 1
  fi
fi