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/openvpn.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/openvpn.rb')
| -rw-r--r-- | Library/Formula/openvpn.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Library/Formula/openvpn.rb b/Library/Formula/openvpn.rb index 9d0732fce..308a1c500 100644 --- a/Library/Formula/openvpn.rb +++ b/Library/Formula/openvpn.rb @@ -36,8 +36,8 @@ class Openvpn < Formula (var + 'run/openvpn').mkpath # Write the launchd script - (prefix + 'org.openvpn.plist').write startup_plist - (prefix + 'org.openvpn.plist').chmod 0644 + plist_path.write startup_plist + plist_path.chmod 0644 end def caveats; <<-EOS @@ -58,12 +58,12 @@ For OpenVPN to work as a server, you will need to do the following: 2) Install the launchd item in /Library/LaunchDaemons, like so: - sudo cp -vf #{prefix}/org.openvpn.plist /Library/LaunchDaemons/. - sudo chown -v root:wheel /Library/LaunchDaemons/org.openvpn.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.openvpn.plist + sudo launchctl load /Library/LaunchDaemons/#{plist_path.basename} Next boot of system will automatically start OpenVPN. EOS @@ -76,7 +76,7 @@ EOS <plist version="1.0"> <dict> <key>Label</key> - <string>org.openvpn</string> + <string>#{plist_name}</string> <key>ProgramArguments</key> <array> <string>#{HOMEBREW_PREFIX}/sbin/openvpn</string> |
