Skip to content

Instantly share code, notes, and snippets.

@frdmn
Last active September 30, 2015 10:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frdmn/c6700ade5a0fc906271f to your computer and use it in GitHub Desktop.
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
#!/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