Skip to content

Instantly share code, notes, and snippets.

@kconner
Created October 22, 2014 14:07
Show Gist options
  • Save kconner/57331b140a610e6ae9e5 to your computer and use it in GitHub Desktop.
Save kconner/57331b140a610e6ae9e5 to your computer and use it in GitHub Desktop.
Monitor whether a given URL gives you a 200
#!/bin/bash
echo "Monitoring."
while true; do
if curl -s --head $1 | grep "200 OK" > /dev/null; then
echo "ok" $1
else
echo ":(" $1
fi
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment