From b5a5217ba3117dfbfcad63532c2054d83d3249c0 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 30 Dec 2011 23:56:52 -0600 Subject: Add and use plist helper methods These will be used to unify the label namespaces in embedded plists, i.e. 'homebrew.mxcl.'. plist_path returns the full path to a plist file located at the top level of the keg; plist_path.basename can be used if just the filename is needed. c.f. #9346. Signed-off-by: Jack Nagel --- Library/Formula/ddclient.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Library/Formula/ddclient.rb') diff --git a/Library/Formula/ddclient.rb b/Library/Formula/ddclient.rb index 5bba3ef76..64ed85254 100644 --- a/Library/Formula/ddclient.rb +++ b/Library/Formula/ddclient.rb @@ -36,8 +36,8 @@ class Ddclient < Formula (var + 'run/ddclient').mkpath # Write the launchd script - (prefix + 'org.ddclient.plist').write startup_plist - (prefix + 'org.ddclient.plist').chmod 0644 + plist_path.write startup_plist + plist_path.chmod 0644 end def caveats; <<-EOS @@ -51,21 +51,21 @@ For ddclient to work, you will need to do the following: 2) Install the launchd item in /Library/LaunchDaemons, like so: - sudo cp -vf #{prefix}/org.ddclient.plist /Library/LaunchDaemons/ - sudo chown -v root:wheel /Library/LaunchDaemons/org.ddclient.plist + sudo cp -vf #{plist_path} /Library/LaunchDaemons/ + sudo chown -v root:wheel /Library/LaunchDaemons/#{plist_path.basename} 3) Start the daemon using: - sudo launchctl load /Library/LaunchDaemons/org.ddclient.plist + sudo launchctl load /Library/LaunchDaemons/#{plist_path.basename} The next reboot of the system will automatically start ddclient. You can adjust the execution interval by changing the value of -StartInterval (in seconds) in /Library/LaunchDaemons/org.ddclient.plist, +StartInterval (in seconds) in /Library/LaunchDaemons/#{plist_path.basename}, and then - sudo launchctl unload /Library/LaunchDaemons/org.ddclient.plist - sudo launchctl load /Library/LaunchDaemons/org.ddclient.plist + sudo launchctl unload /Library/LaunchDaemons/#{plist_path.basename} + sudo launchctl load /Library/LaunchDaemons/#{plist_path.basename} EOS end @@ -76,7 +76,7 @@ EOS Label - org.ddclient + #{plist_name} ProgramArguments #{HOMEBREW_PREFIX}/sbin/ddclient -- cgit v1.2.3