Changeset 870 for trunk/DNSDB
- Timestamp:
- 09/28/22 15:56:15 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB/ExportBIND.pm
r869 r870 43 43 # Fetch active zone list 44 44 my $revsth = $dnsdb->{dbh}->prepare("SELECT rdns_id,revnet,status,changed,default_location FROM revzones WHERE status=1 ". 45 "ORDER BY masklen(revnet) DESC, rdns_id");45 "ORDER BY masklen(revnet),revnet DESC, rdns_id"); 46 46 # Unflag changed zones, so we can maybe cache the export and not redo everything every time 47 47 my $zonesth = $dnsdb->{dbh}->prepare("UPDATE revzones SET changed='n' WHERE rdns_id=?"); … … 105 105 open $zonefiles{$loc}, ">", $zfilepath; 106 106 printf {$zonefiles{$loc}} "; %s in view %s exported %s\n", $arpazone, $loc, scalar(localtime) 107 or die "Error writing SOA [$zone, '$loc']: $!\n";; 108 } 107 or die "Error writing header [$zone, '$loc']: $!\n";; 108 # tag the zonefile for publication in the view 109 push @{$viewzones{$loc}}, $arpazone; 110 } # foreach @loclist 109 111 110 112 # need to fetch this separately since the rest of the records all (should) have real IPs in val … … 198 200 open BINDCONF, ">", $tmpconf; 199 201 200 foreach my $view (@{$viewlist} ) {202 foreach my $view (@{$viewlist}, 'common') { 201 203 #print Dumper($view); 202 204 print BINDCONF "view $view->{location} {\n"; … … 207 209 # same as a BIND view with match-clients { any; }; 208 210 if ($view->{iplist}) { 209 print BINDCONF " match-clients { ".join("; ", $view-> iplist)."; };\n";211 print BINDCONF " match-clients { ".join("; ", $view->{iplist})."; };\n"; 210 212 # print " match-clients { ".join("; ", split(/[\s,]+/, $view->{iplist}))."; };\n"; 211 213 } else { … … 217 219 print qq( zone "$zone" IN {\n\ttype master;\n\tnotify no;\n\tfile "db.$zone";\n };\n); 218 220 } 221 print BINDCONF "};\n\n"; 219 222 print "};\n\n"; 220 223 } # foreach @$viewlist
Note:
See TracChangeset
for help on using the changeset viewer.