[sup-talk] Hooks?
William Morgan
wmorgan-sup at masanjin.net
Sun Sep 2 02:28:52 EDT 2007
Excerpts from Magnus Therning's message of Sat Sep 01 16:47:03 -0700 2007:
> There seems to be extended support for inserting hooks in sup.
> However, any sort of hint as to how to add a hook is missing. I
> assume they have to be written in Ruby, they should probably live in
> ~/.sup/hooks.
Hooks were added just a couple SVN revisions ago so documentation isn't
great. Running sup -l will give you a list of possible hooks and their
corresponding locations on disk. Here's my current set of hooks (and if
you search the list archives I've posted a couple more examples):
$ head .sup/hooks/*.rb
==> .sup/hooks/before-poll.rb <==
if (@last_fetchmail_time || Time.at(0)) < Time.now - 60
say "Running fetchmail..."
system "fetchmail >& /dev/null"
say "Done running fetchmail."
end
@last_fetchmail_time = Time.now
==> .sup/hooks/mime-decode.rb <==
unless sibling_types.member? "text/plain"
case content_type
when "text/html"
`/usr/bin/w3m -dump -T #{content_type} '#{filename}'`
end
end
==> .sup/hooks/signature.rb <==
"William <#{from_email}>"
--
William <wmorgan-sup at masanjin.net>
More information about the sup-talk
mailing list