Skip to content

Instantly share code, notes, and snippets.

@svolpe43
Created October 24, 2015 05:09
Show Gist options
  • Save svolpe43/e61d9428494b20b9a48a to your computer and use it in GitHub Desktop.
Save svolpe43/e61d9428494b20b9a48a to your computer and use it in GitHub Desktop.
#!/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