Created
February 11, 2019 06:05
-
-
Save tjstebbing/a4e0b1f92ce7a42bab9c29a9c0d06ead to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| #apt-get install html-xml-utils | |
| bridgeURL="http://howmanydayssincemontaguestreetbridgehasbeenhit.com" | |
| hookURL="http://example.com" | |
| days=$(echo "$bridgeURL" | \ | |
| wget -O- -i- 2>/dev/null | hxnormalize -x | hxselect -i '.day_box' \ | |
| | grep -o -E '[0-9+]') | |
| echo "Days since crash $days" | |
| if [[ $days == 0 ]]; then | |
| echo "calling hook" | |
| wget $hookURL | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment