diff options
author | Ivan Kohler <ivan@freeside.biz> | 2024-07-03 12:26:10 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2024-07-03 12:26:10 -0700 |
commit | 1a8bf7c0df6db5462e01e67da2e259c1ef574011 (patch) | |
tree | 675fc5ebab47009e0ab68c0b6a45abc50e1e98fe /bin | |
parent | 5736b748338a6737f6c24c063b724ebdb77fb79f (diff) |
BIND local_zonepath override
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bind.export | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/bin/bind.export b/bin/bind.export index a3bbd1ac5..9c5130b11 100755 --- a/bin/bind.export +++ b/bin/bind.export @@ -20,10 +20,10 @@ mkdir $spooldir, 0700 unless -d $spooldir; my @exports = qsearch('part_export', { 'exporttype' => 'bind' } ); my @sexports = qsearch('part_export', { 'exporttype' => 'bind_slave' } ); -my $rsync = File::Rsync->new({ +my $rsync = File::Rsync->new( rsh => 'ssh', # dry_run => 1, -}); +); foreach my $export ( @exports ) { @@ -50,7 +50,8 @@ foreach my $export ( @exports ) { close CONF_HEADER; } - my $zonepath = $export->option('zonepath'); + my $zonepath = $export->option('local_zonepath') + || $export->option('zonepath'); $zonepath =~ s/\/$//; my @svc_domain = $export->svc_x; @@ -112,18 +113,18 @@ END } - $rsync->exec( { + $rsync->exec( src => "$prefix/", recursive => 1, dest => "root\@$machine:$zonepath/", exclude => [qw( *.import named.conf.HEADER named.conf )], - } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err); + ) or die "rsync to $machine failed: ". join(" / ", $rsync->err); # warn $rsync->out; - $rsync->exec( { + $rsync->exec( src => "$prefix/named.conf", dest => "root\@$machine:". $export->option('named_conf'), - } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err); + ) or die "rsync to $machine failed: ". join(" / ", $rsync->err); # warn $rsync->out; ssh("root\@$machine", "$ndc_cmd reload"); @@ -177,10 +178,10 @@ END } - $rsync->exec( { + $rsync->exec( src => "$prefix/named.conf", dest => "root\@$machine:". $sexport->option('named_conf'), - } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err); + ) or die "rsync to $machine failed: ". join(" / ", $rsync->err); # warn $rsync->out; ssh("root\@$machine", "$ndc_cmd reload"); |