sbin/zone-mk
branchfoerste
changeset 152 1ed33114d87f
parent 150 3db363880766
equal deleted inserted replaced
149:44183c6b78b6 152:1ed33114d87f
    24     GetOptions(
    24     GetOptions(
    25         "f|force" => \$opt_force,
    25         "f|force" => \$opt_force,
    26         "h|help"  => sub { pod2usage(-verbose => 1, -exit => 0) },
    26         "h|help"  => sub { pod2usage(-verbose => 1, -exit => 0) },
    27         "m|man"   => sub {
    27         "m|man"   => sub {
    28             pod2usage(
    28             pod2usage(
    29                 -verbose   => 2,
    29                 -verbose => 2,
    30                 # "system('perldoc -V &>/dev/null')" appears shorter, but may not
    30 
    31                 # do what you expect ( it still returns 0 on debian squeeze with
    31                # "system('perldoc -V &>/dev/null')" appears shorter, but may not
    32                 # dash as system shell even if cannot find the command in $PATH)
    32                # do what you expect ( it still returns 0 on debian squeeze with
       
    33                # dash as system shell even if cannot find the command in $PATH)
    33                 -noperldoc => system('perldoc -V >/dev/null 2>&1'),
    34                 -noperldoc => system('perldoc -V >/dev/null 2>&1'),
    34                 -exit      => 0
    35                 -exit      => 0
    35             );
    36             );
    36         },
    37         },
    37       )
    38       )
    46     # legt fuer jede Zone in @ARGV ein verzeichnis in $master_dir an.
    47     # legt fuer jede Zone in @ARGV ein verzeichnis in $master_dir an.
    47     # schreibt aus den angegebenen templates die dateien $zonefile und $config
    48     # schreibt aus den angegebenen templates die dateien $zonefile und $config
    48     # in die entsprechenden verzeichnisse.
    49     # in die entsprechenden verzeichnisse.
    49     for my $utf8zone (@ARGV) {
    50     for my $utf8zone (@ARGV) {
    50 
    51 
    51         my $zone     = idn_to_ascii($utf8zone, $CHARSET);
    52         my $zone       = idn_to_ascii($utf8zone, $CHARSET);
    52         my $zonefile   = "$cf{master_dir}/$zone/$zone";
    53         my $zonefile   = "$cf{master_dir}/$zone/$zone";
    53         my $configfile = "$cf{zone_conf_dir}/$zone";
    54         my $configfile = "$cf{zone_conf_dir}/$zone";
    54         my $now        = time;
    55         my $now        = time;
    55 
    56 
    56         mkpath dirname $zonefile;
    57         mkpath dirname $zonefile;
    66         }
    67         }
    67 
    68 
    68         say "zone $utf8zone ($zone) for $customer.";
    69         say "zone $utf8zone ($zone) for $customer.";
    69 
    70 
    70         my %vars = (
    71         my %vars = (
    71             zone     => $zone,
    72             zone       => $zone,
    72             utf8zone => $utf8zone,
    73             utf8zone   => $utf8zone,
    73             now        => $now,
    74             now        => $now,
    74             zonefile   => abs_path($zonefile),
    75             zonefile   => abs_path($zonefile),
    75             customer   => $customer,
    76             customer   => $customer,
    76             hostmaster => $cf{hostmaster},
    77             hostmaster => $cf{hostmaster},
    77             primary    => $cf{primary},
    78             primary    => $cf{primary},