Sha256: e56b1583091226db552f61ebf3dc719011c0950dcbbf1983c965cccd9abdc734

Contents?: true

Size: 516 Bytes

Versions: 4

Compression:

Stored size: 516 Bytes

Contents

module Dyndnsd
  module Updater
    class CommandWithBindZone
      def initialize(domain, config)
        @zone_file = config['zone_file']
        @command = config['command']
        @generator = Generator::Bind.new(domain, config)
      end
      
      def update(zone)
        # write zone file in bind syntax
        File.open(@zone_file, 'w') { |f| f.write(@generator.generate(zone)) }
        # call user-defined command
        pid = fork do
          exec @command
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dyndnsd-1.0.0 lib/dyndnsd/updater/command_with_bind_zone.rb
dyndnsd-0.0.4 lib/dyndnsd/updater/command_with_bind_zone.rb
dyndnsd-0.0.3 lib/dyndnsd/updater/command_with_bind_zone.rb
dyndnsd-0.0.2 lib/dyndnsd/updater/command_with_bind_zone.rb