ssl.rb 535 Bytes
Newer Older
telyn's avatar
telyn committed
1
2
require 'symbiosis'

3
4
module Symbiosis
  class SSL
5
    PROVIDERS ||= []
telyn's avatar
telyn committed
6
7
8
9

    def self.call_hooks(domains_with_updates)
      return if domains_with_updates.empty?

telyn's avatar
telyn committed
10
11
12
      hooks_path = Symbiosis.path_to('/etc/symbiosis/ssl-hooks.d/*')

      Dir.glob(hooks_path).each do |script|
telyn's avatar
telyn committed
13
14
15
16
17
18
19
        next unless File.executable?(script)
        IO.popen([script, 'live-update'], 'r+') do |io|
          io.puts domains_with_updates.join("\n")
          io.close_write # Close the pipe now we've written stuff.
        end
      end
    end
20
21
  end
end