Created
October 24, 2015 05:09
-
-
Save svolpe43/e61d9428494b20b9a48a to your computer and use it in GitHub Desktop.
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 -l | |
echo "Checking City of Boston db for R60CTR.." | |
resp=`curl -isS http://www.cityofboston.gov/towing/search/?plate=R60CTR` | |
# make sure the request came back ok | |
if echo $resp | grep "HTTP/1.1 200 OK"; then | |
# check for the criteria | |
if echo $resp | grep -pG "Plate not found."; then | |
result=" " | |
message="R60CTR not found." | |
else | |
result="FOUND" | |
message="R60CTR found using http://www.cityofboston.gov/towing/search/?plate=R60CTR." | |
fi | |
else | |
result=`echo $resp | head -n 1` | |
message="Seems to have had a http error." | |
fi | |
echo "[$result] [$(date)] $message" >> ~/bin/towcheck/results.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment