-1

I'm trying to find a programmatic solution to 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).

idleberg
  • 12,634
  • 7
  • 43
  • 70
  • "Given that Apple offers a way to hook a script `post_upgrade`." Never heard of such a thing (don't even know what you're talking about, actually; what is `post_upgrade`? In what language? Or from what command?). If you already know this exists, why are you even asking? If this is instead what you are looking for, your English doesn't seem to convey what you want to convey. – 4ae1e1 Nov 08 '15 at 06:10

2 Answers2

0
  1. Create a file with the following script:
#!/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
  1. chmod +x it
  2. sudo nano /Library/LaunchDaemons/version-checker.plist
  3. Type in:
<?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>
  1. Save with CTRL+X, Y
  2. sudo launchctl load /Library/LaunchDaemons/version-checker.plist
Sam Denty
  • 3,693
  • 3
  • 30
  • 43
-2

You can:

  • Sart Automator.app
  • Select "Application"
  • Click "Show library" in the toolbar (if hidden)
  • Add "Run shell script" (from the Actions/Utilities)
  • Copy&paste your script into the window
  • Test it
  • Save somewhere, for example you can make an "Applications" folder in your HOME (you will get an your_name.app)
  • Go to System Preferences -> Accounts -> Login items
  • Add this app
  • test & done
Dup Step
  • 218
  • 1
  • 6