Last active
September 30, 2015 10:28
-
-
Save frdmn/c6700ade5a0fc906271f to your computer and use it in GitHub Desktop.
El Capitan availability checker - read the installation instructions in the bash script below
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Installation instructions: | |
# $ curl -s https://gist.githubusercontent.com/frdmn/c6700ade5a0fc906271f/raw/checker.sh > /usr/local/bin/osx-checker | |
# $ chmod +x /usr/local/bin/osx-checker | |
# $ osx-checker | |
URL="https://itunes.apple.com/search?entity=macSoftware&term=OS+X" | |
SEARCH_STRING="OS X El Capitan" | |
TIMEOUT_IN_SECONDS="60" | |
echo "${SEARCH_STRING} MAS availability checker" | |
echo "" | |
while true; do | |
curl -s "${URL}" | python -mjson.tool | grep "trackCensoredName\": \"${SEARCH_STRING}" | |
if [ "$?" == "0" ]; then | |
say "${SEARCH_STRING} is now available for download" | |
open $URL | |
exit | |
else | |
echo "Nothing found yet. Trying again in ${TIMEOUT_IN_SECONDS} seconds..." | |
fi | |
sleep ${TIMEOUT_IN_SECONDS} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment