Skip to content

Instantly share code, notes, and snippets.

@kccheung
Forked from monkeydom/applestorede.sh
Created August 13, 2016 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kccheung/a2f8a5c7f9796d282f7fed9dc2bdfa18 to your computer and use it in GitHub Desktop.
Save kccheung/a2f8a5c7f9796d282f7fed9dc2bdfa18 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