Skip to content

Instantly share code, notes, and snippets.

@notakaos
Last active August 29, 2015 14:03
Show Gist options
  • Save notakaos/016759dca85135361d52 to your computer and use it in GitHub Desktop.
Save notakaos/016759dca85135361d52 to your computer and use it in GitHub Desktop.
create custom homebrew cask td-agent2(fluentd)
$ brew cask create td-agent2
# /usr/local/Library/Taps/caskroom/homebrew-cask/Casks/td-agent2.rb
class TdAgent2 < Cask
  version '2.0.2'
  sha256 '00c090151f38ddecaf5174b5d31891fa8961375bc50b9537faec9e6728e2f51e'

  url 'http://packages.treasuredata.com/2/macosx/td-agent-2.0.2-0.dmg'
  homepage 'http://www.fluentd.org/'

  install 'td-agent2.pkg'
  uninstall :pkgutil => 'test.treasuredatainc.pkg.tdagent2'

  after_install do
    system 'sudo', '/bin/launchctl', 'load', '-w', '/Library/LaunchDaemons/td-agent.plist'
  end

  before_uninstall do
    system 'sudo', '/bin/launchctl', 'unload', '-w', '/Library/LaunchDaemons/td-agent.plist'
  end
end
brew cask install td-agent2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment