diff options
| author | Jack Nagel | 2011-12-30 23:56:52 -0600 |
|---|---|---|
| committer | Jack Nagel | 2012-02-03 19:50:58 -0600 |
| commit | b5a5217ba3117dfbfcad63532c2054d83d3249c0 (patch) | |
| tree | 1cb6f20dbb550463da7ccc1ad012afea251c0a32 /Library/Formula/ddclient.rb | |
| parent | 95e379faf1de79a46bd49dcf890b8053afde58b8 (diff) | |
| download | homebrew-b5a5217ba3117dfbfcad63532c2054d83d3249c0.tar.bz2 | |
Add and use plist helper methods
These will be used to unify the label namespaces in embedded plists,
i.e. 'homebrew.mxcl.<formula>'.
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 <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula/ddclient.rb')
| -rw-r--r-- | Library/Formula/ddclient.rb | 18 |
1 files changed, 9 insertions, 9 deletions
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 <plist version="1.0"> <dict> <key>Label</key> - <string>org.ddclient</string> + <string>#{plist_name}</string> <key>ProgramArguments</key> <array> <string>#{HOMEBREW_PREFIX}/sbin/ddclient</string> |
