Sha256: 6b9ec7488e3ba862461315ed26cd13da0cf6cf075ea3cfbddea48caaaf2cf35d
Contents?: true
Size: 594 Bytes
Versions: 9
Compression:
Stored size: 594 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 # detach so children don't become zombies Process.detach(pid) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems