The gist with this script disappeared, adding to the repo since it's so useful. Added some error handling/logging to the script.