Changeset 853 for trunk/DNSDB
- Timestamp:
- 09/15/22 15:46:07 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB/ExportBIND.pm
r851 r853 60 60 61 61 62 # fetch a list of views/locations present in the zone. we need to publish a file for each one.63 # in the event that no locations are present (~~ $viewlist is empty), /%view collapses to nothing in the zone path64 my (@loclist) = $self->{dbh}->selectrow_array("SELECT DISTINCT location FROM records WHERE rdns_id = ?", undef, $revid);65 push @loclist, $defloc unless grep /$defloc/, @loclist;66 my $zonepath = $self->{bind_export_zone_path};67 my %zonefiles; # to be a list of file handles.68 ##fixme: convert logical revzone into .arpa name69 foreach my $loc (@loclist) {70 my $zfilepath = $zonepath;71 $zonepath =~ s/\%view/$loc/;72 $zonepath =~ s/\%zone/$revzone/;73 # Just In Case(TM)74 $zonepath =~ s,[^\w./-],_,g;75 #open $zonefiles{$loc}, ">", $zfilepath;76 print "open zonefile for '$loc', '$zonepath'\n";77 }78 79 62 eval { 80 63 … … 90 73 $zonefilehandle = *ZONECACHE; 91 74 } 75 76 # fetch a list of views/locations present in the zone. we need to publish a file for each one. 77 # in the event that no locations are present (~~ $viewlist is empty), /%view collapses to nothing in the zone path 78 my (@loclist) = $self->{dbh}->selectrow_array("SELECT DISTINCT location FROM records WHERE rdns_id = ?", undef, $revid); 79 push @loclist, $defloc unless grep /$defloc/, @loclist; 80 my $zonepath = $self->{bind_export_zone_path}; 81 my %zonefiles; # to be a list of file handles. 82 ##fixme: convert logical revzone into .arpa name 83 foreach my $loc (@loclist) { 84 my $zfilepath = $zonepath; 85 $zfilepath =~ s/\%view/$loc/; 86 $zfilepath =~ s/\%zone/$revzone/; 87 # Just In Case(TM) 88 $zfilepath =~ s,[^\w./-],_,g; 89 #open $zonefiles{$loc}, ">", $zfilepath; 90 print "open zonefile for '$loc', '$zfilepath'\n"; 91 } 92 92 93 93 94 # need to fetch this separately since the rest of the records all (should) have real IPs in val
Note:
See TracChangeset
for help on using the changeset viewer.