Skip to content

Instantly share code, notes, and snippets.

@karmanyaahm
Created October 24, 2020 02:31
Show Gist options
  • Save karmanyaahm/60de454d30b5b2538e27802484209dd2 to your computer and use it in GitHub Desktop.
Save karmanyaahm/60de454d30b5b2538e27802484209dd2 to your computer and use it in GitHub Desktop.
Status of status server backup gotify
#!/bin/bash
SERVER_NAME="STATUS"
URL="https://status.malhotra.cc"
TIMEOUT=10
GOTIFYURL="https://gotify.example.com"
GOTIFY_TOKEN="token"
PRIORITY=9
STATUS=$(curl -m $TIMEOUT "$URL" -w "%{http_code}\\n" -I -o /dev/null 2>/dev/null)
#echo $VAR
if [ $STATUS != 200 ]
then
curl "$GOTIFYURL/message?token=$GOTIFY_TOKEN" -F "title=$SERVER_NAME SERVER ISSUE!!!!" -F "message=something wrong with $URL server. Regards, your script" -F "priority=$PRIORITY"
echo ""
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment