Skip to content

Instantly share code, notes, and snippets.

@rjaeckel
Created April 2, 2014 07:11
Show Gist options
  • Save rjaeckel/9929284 to your computer and use it in GitHub Desktop.
Save rjaeckel/9929284 to your computer and use it in GitHub Desktop.
curl-http-status-cron
#!/bin/bash
curl=/usr/bin/curl
hosts="www.vk.uni-halle.de www.wissenschaftsnacht-halle.de"
for host in $hosts; do
http_status=$($curl curl -sI --get http://$host | head -n1 | awk '{print $2}' )
if [[ "$http_status" -ne "200" ]]; then
echo "Host $host returned status '$http_status'"
fi
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment