Created
March 6, 2014 10:33
-
-
Save metrofx/9387016 to your computer and use it in GitHub Desktop.
I'm tired of waiting for DNS Propagation, so I created this script and put it in crontab. Then I leave my desk for pingpong session...
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 | |
TOKEN=<your Pushover token> | |
USER=<generated by Pushover> | |
MSG="Udah up nih bro!" | |
URL="url-you-need-to-check" | |
out=$(curl --write-out "%{http_code}\n" --silent --output /dev/null $URL) | |
if [ $out = '200' ] ; then | |
curl -s \ | |
-F "token=$TOKEN" \ | |
-F "user=$USER" \ | |
-F "message=$MSG" \ | |
https://api.pushover.net/1/messages | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment