#!/usr/bin/ruby # # Copyright (c) 2004,2005 Florian Reitmeir # based on a script from Peter Palfrader # # All rights reserved. # # MIT license. # require "ldap" require "getoptlong" require "myldap" require "yaml" require "fileutils" require "optparse" # defaults $force_rebuild = false def show_help(parser, code=0, io=STDOUT) io.puts parser exit(code) end ARGV.options do |opts| opts.on_tail("-h", "--help", "Display this help screen") { show_help(opts) } opts.on("-f", "--force" , String, "Force rebuilding the cachefiles") { $force_rebuild = true } opts.parse! end @config = YAML::load( File.open( '/etc/noreply/config' ) ) ldap = MyLDAP.new(@config, "ldap2apache") clients = ldap.conn.search2(@config['basedn'], LDAP::LDAP_SCOPE_SUBTREE, 'objectclass=tnClient') @config_dir = @config['module']['analog']['config'] @analog_dns = @config['module']['analog']['dns'] @analog_caches = @config['module']['analog']['caches'] @analog_output = @config['module']['analog']['output'] @rmagic_dest = @config['module']['analog']['rmagic'] @analog_common = <