#!/usr/bin/env bash
DOMAIN=portal.nightly-upgrade.opendesk.qa

while [ ! -f ~/this-is-the-end ]; do
  curl "https://${DOMAIN}/univention/command/passwordreset/send_token" \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: de-DE' \
  -H 'content-type: application/json;charset=UTF-8' \
  -H 'cookie: UMCLang=de-DE' \
  -H "origin: https://${DOMAIN}" \
  -H "priority: u=1, i" \
  -H "referer: https://${DOMAIN}/univention/portal/" \
  -H 'sec-ch-ua: "Not)A;Brand";v="99", "Google Chrome";v="127", "Chromium";v="127"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36' \
  -H 'x-requested-with: XMLHttpRequest' \
  --data-raw '{"options":{"username":"unknown.user","method":"email"}}'
  echo
done
