Skip to content

Instantly share code, notes, and snippets.

@obihann
Created August 25, 2014 18:31
Show Gist options
  • Save obihann/cd5fb8e73c3489c1028b to your computer and use it in GitHub Desktop.
Save obihann/cd5fb8e73c3489c1028b to your computer and use it in GitHub Desktop.
TT++ MUD Log Check
#!/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