Skip to content

Instantly share code, notes, and snippets.

@rosskevin
Created October 14, 2016 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rosskevin/5364f5424f9783af772519ff0e18e80d to your computer and use it in GitHub Desktop.
Save rosskevin/5364f5424f9783af772519ff0e18e80d to your computer and use it in GitHub Desktop.
OSX sabnzbd daemon using launchctl with a wait for the volume to be present (using MountWatcher)
?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>com.sabnzbd.SABnzbd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/open</string>
<string>-a</string>
<string>/Applications/SABnzbd.app</string>
</array>
<key>KeepAlive</key>
<dict>
<key>PathState</key>
<dict>
<key>/Volumes/downloads</key>
<true/>
</dict>
</dict>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
# create the plist file (insert the text from the other file)
vi ~/Library/LaunchAgents/com.sabnzbd.SABnzbd.plist
# BE SURE to change the /Volumes location to match yours!
# load it (be sure to have sab shut down before running this)
launchctl load ~/Library/LaunchAgents/com.sabnzbd.SABnzbd.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment