bin/zone-mk
changeset 94 54252e5987f2
parent 87 6d624831079f
child 103 0c9f37c94f0c
equal deleted inserted replaced
93:c14527ff4d1f 94:54252e5987f2
    38     my $customer = shift;
    38     my $customer = shift;
    39 
    39 
    40     die "$cf{master_dir}: $!"    if not -d -r -x $cf{master_dir};
    40     die "$cf{master_dir}: $!"    if not -d -r -x $cf{master_dir};
    41     die "$cf{zone_conf_dir}: $!" if not -d -r -x $cf{zone_conf_dir};
    41     die "$cf{zone_conf_dir}: $!" if not -d -r -x $cf{zone_conf_dir};
    42 
    42 
    43     # legt fuer jede domain in @ARGV ein verzeichnis in $master_dir an.
    43     # legt fuer jede Zone in @ARGV ein verzeichnis in $master_dir an.
    44     # schreibt aus den angegebenen templates die dateien $zonefile und $config
    44     # schreibt aus den angegebenen templates die dateien $zonefile und $config
    45     # in die entsprechenden verzeichnisse.
    45     # in die entsprechenden verzeichnisse.
    46     for my $utf8domain (@ARGV) {
    46     for my $utf8zone (@ARGV) {
    47 
    47 
    48         my $domain     = idn_to_ascii($utf8domain, $CHARSET);
    48         my $zone     = idn_to_ascii($utf8zone, $CHARSET);
    49         my $zonefile   = "$cf{master_dir}/$domain/$domain";
    49         my $zonefile   = "$cf{master_dir}/$zone/$zone";
    50         my $configfile = "$cf{zone_conf_dir}/$domain";
    50         my $configfile = "$cf{zone_conf_dir}/$zone";
    51         my $now        = time;
    51         my $now        = time;
    52 
    52 
    53         make_path dirname $zonefile;
    53         make_path dirname $zonefile;
    54 
    54 
    55         if (-f $zonefile and not $opt_force) {
    55         if (-f $zonefile and not $opt_force) {
    56             say "skipping $utf8domain: zone file '$zonefile' exists.";
    56             say "skipping $utf8zone: zone file '$zonefile' exists.";
    57             next;
    57             next;
    58         }
    58         }
    59 
    59 
    60         if (-f $configfile and not $opt_force) {
    60         if (-f $configfile and not $opt_force) {
    61             say "skipping $utf8domain: config file '$configfile' exists.";
    61             say "skipping $utf8zone: config file '$configfile' exists.";
    62             next;
    62             next;
    63         }
    63         }
    64 
    64 
    65         say "domain $utf8domain ($domain) for $customer.";
    65         say "zone $utf8zone ($zone) for $customer.";
    66 
    66 
    67         my %vars = (
    67         my %vars = (
    68             domain     => $domain,
    68             zone     => $zone,
    69             utf8domain => $utf8domain,
    69             utf8zone => $utf8zone,
    70             now        => $now,
    70             now        => $now,
    71             zonefile   => abs_path($zonefile),
    71             zonefile   => abs_path($zonefile),
    72             customer   => $customer,
    72             customer   => $customer,
    73             hostmaster => $cf{hostmaster},
    73             hostmaster => $cf{hostmaster},
    74             primary    => $cf{primary},
    74             primary    => $cf{primary},
    91 
    91 
    92     zone-mk - create a new zone
    92     zone-mk - create a new zone
    93 
    93 
    94 =head1 SYNOPSIS
    94 =head1 SYNOPSIS
    95 
    95 
    96     zone-mk [-f|--force] <customer-id> <domain>...
    96     zone-mk [-f|--force] <customer-id> <zone>...
    97 
    97 
    98 =head1 DESCRIPTION
    98 =head1 DESCRIPTION
    99 
    99 
   100 B<zone-mk> creates a new DNS zone file and the config snipped.
   100 B<zone-mk> creates a new DNS zone file and the config snipped. Nothing
       
   101 else (especially no DNSSEC, and no bind integration) is done.
   101 
   102 
   102 =head1 OPTIONS
   103 =head1 OPTIONS
   103 
   104 
   104 =over
   105 =over
   105 
   106