diff --git a/Formula/squid.rb b/Formula/squid.rb index decc5f2b4a..8a775857af 100644 --- a/Formula/squid.rb +++ b/Formula/squid.rb @@ -34,4 +34,48 @@ class Squid < Formula "--localstatedir=#{var}" system "make install" end + + def caveats; <<-EOS.undent + + To launch on startup: + + * if this is your first install: + mkdir -p ~/Library/LaunchAgents + cp #{plist_path} ~/Library/LaunchAgents/ + launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} + + * if this is an upgrade and you already have the #{plist_path.basename} loaded: + launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename} + cp #{plist_path} ~/Library/LaunchAgents/ + launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} + + EOS + end + + def startup_plist; <<-EOPLIST.undent + + + + + KeepAlive + + Label + #{plist_name} + ProgramArguments + + /usr/local/sbin/squid + -N + -d 1 + -D + + RunAtLoad + + UserName + #{`whoami`.chomp} + WorkingDirectory + #{var} + + + EOPLIST + end end