Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.