Created
November 12, 2020 18:07
-
-
Save attilagyorffy/3393fcb6014b99cb2d56c7be1f522728 to your computer and use it in GitHub Desktop.
Excited about the imminent availability of Big Sur but tired of checking the software update pane in System Preferences? Use this Ruby script to automate it and get a notification once it's available in your region.
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
# NOTE: This script assumes that you system is otherwise updated, ie no other update is pending. | |
# You can add this script into crontab to run every 5 mins: */5 * * * * | |
require 'open3' | |
Open3.popen3("softwareupdate -l --force") do |_stdin, _stdout, stderr, _thread| | |
unless stderr.read.match? /No new software available./ | |
exec(%q{osascript -e "display notification \"You have an update available.\""}) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment