don't copy zonefile from the ns server if already in tmpdir
This commit is contained in:
parent
d0973dc0e3
commit
c563daacc7
16
lib/zone.pm
16
lib/zone.pm
@ -96,7 +96,21 @@ sub get_zonefile {
|
|||||||
my $file = $self->get_remote_zf_();
|
my $file = $self->get_remote_zf_();
|
||||||
my $dest = $self->get_ztmp_file_();
|
my $dest = $self->get_ztmp_file_();
|
||||||
|
|
||||||
copycat ($file, $dest);
|
my $path = $dest;
|
||||||
|
|
||||||
|
# dest is the filename
|
||||||
|
if($dest =~ "://") {
|
||||||
|
my $fileuri = URI->new($dest);
|
||||||
|
$path = $fileuri->path;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( -f $path ) {
|
||||||
|
say "FILE $path already exists : do not copy from ns server";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
copycat ($file, $dest);
|
||||||
|
}
|
||||||
|
|
||||||
zonefile->new(domain => $$self{domain}, zonefile => $dest);
|
zonefile->new(domain => $$self{domain}, zonefile => $dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user