Skip to content

Instantly share code, notes, and snippets.

@monkeydom
Created March 24, 2011 21:02
Show Gist options
  • Save monkeydom/885877 to your computer and use it in GitHub Desktop.
Save monkeydom/885877 to your computer and use it in GitHub Desktop.
Apple store is down script
#!/bin/bash
WaitForDown=true
while true; do
StoreUp=`curl -s http://store.apple.com/de | grep "Mac kaufen" | wc -l`
if [ $StoreUp -eq 0 ]; then
if $WaitForDown; then
WaitForDown=false
date
echo "The Apple Store is Down!"
say "The Apple Store is Down!"
fi
sleep 5
else
if $WaitForDown; then
echo -n "still up. "
sleep 5
else
say "It is up, buy now!"
echo "It is up, buy now!"
sleep 1
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment