Created
October 24, 2020 02:31
-
-
Save karmanyaahm/60de454d30b5b2538e27802484209dd2 to your computer and use it in GitHub Desktop.
Status of status server backup gotify
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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