Skip to content

Instantly share code, notes, and snippets.

@RShergold
Last active December 13, 2016 14:09
Show Gist options
  • Save RShergold/652b640e7346e3157c6592b15c3facb4 to your computer and use it in GitHub Desktop.
Save RShergold/652b640e7346e3157c6592b15c3facb4 to your computer and use it in GitHub Desktop.
ping until website returns 200
#!/bin/bash
until [ $STATUS = "200" ]; do
STATUS=`curl -sL -w "%{http_code}\\n" "https://www.example.com/" -o /dev/null`
echo $STATUS
sleep 5
done
echo "Website back up"
osascript -e 'display notification "Website back up" with title "isup"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment