I'm trying to find a programmatic solution for a friend of mine, who operates a Hackintosh system, or OS X installed on non-Macintosh Intel computers. Whenever he is installing a Mac OS X security update, he needs to re-patch his audio drivers using MultiBeast. So, I was thinking about doing this automatically, given that Apple offers a way to hook a script post_upgrade
(which I'm unaware of).
#!/bin/bash
CURR_VERSION="$(sw_vers -buildVersion)"
PREV_VERSION="$(cat ~/.previous-version)"
if [ "$CURR_VERSION" != "$PREV_VERSION" ]; then
# Do stuff here
echo "$CURR_VERSION" > ~/.previous-version
fi
chmod +x
itsudo nano /Library/LaunchDaemons/version-checker.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>version-checker</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/your/check_version.sh</string>
</array>
<key>StartInterval</key>
<integer>60</integer>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
sudo launchctl load /Library/LaunchDaemons/version-checker.plist