Created
August 25, 2014 18:31
-
-
Save obihann/cd5fb8e73c3489c1028b to your computer and use it in GitHub Desktop.
TT++ MUD Log Check
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/sh | |
COUNT=$(cat /home/jeff/Shared/zeb.html | grep "#SESSION 'zeb' DIED." -c) | |
NOW=$(date +%s) | |
L_ERROR=$(cat /var/log/check-zeb-down)+3600 | |
if (( $COUNT >= 1 && $L_ERROR <= $NOW )); then | |
date | |
curl --request POST https://api.pushover.net/1/messages.json --data "token=SECRET_TOKEN&user=SECRET_USER&message=Zeb is linkdead!&priority=1" | |
echo -e $NOW > /var/log/check-zeb-down | |
echo -e "\nZeb is linkdead!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment