Changeset 820
- Timestamp:
- 12/04/20 13:23:49 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bind-import
r819 r820 96 96 open SKIP, "<$skipfile"; 97 97 while (<SKIP>) { 98 chomp; 98 99 push @skipdefs, $_; 99 100 } 101 close SKIP; 100 102 } else { 101 103 warn "skipfile $skipfile requested but it doesn't seem to exist. Continuing.\n"; … … 138 140 $zname = DNSDB::_ZONE($zname, 'ZONE', 'r', '.').($zname->{isv6} ? '.ip6.arpa' : '.in-addr.arpa'); 139 141 } 140 $zid = $dnsdb->{dbh}->do("INSERT INTO revzones (revnet,group_id,status,default_location,zserial) VALUES (?,?,?,?,?) RETURNING rnds_id",142 ($zid) = $dnsdb->{dbh}->selectrow_array("INSERT INTO revzones (revnet,group_id,status,default_location,zserial) VALUES (?,?,?,?,?) RETURNING rnds_id", 141 143 undef, ($zname, $group, $status, $location, $serial)); 142 144 … … 147 149 # die "zone $origzone already present, not merging records\n"; 148 150 print "dbg: skip add domain\n"; 149 } 150 else { 151 $zid = $dnsdb->{dbh}->do("INSERT INTO domains (domain,group_id,status,default_location,zserial) VALUES (?,?,?,?,?) RETURNING domain_id", 151 } else { 152 ($zid) = $dnsdb->{dbh}->selectrow_array("INSERT INTO domains (domain,group_id,status,default_location,zserial) VALUES (?,?,?,?,?) RETURNING domain_id", 152 153 undef, ($zname, $group, $status, $location, $serial)); 153 }154 } 154 155 155 156 } … … 184 185 # arguably should do some more targeted voodoo when parsing the SOA details 185 186 187 ##fixme: would prefer to break the loop below *AND* next; the while starting above 188 # check skiplist. do this early since it's (mostly) a simple string match against the raw record line 189 my $skipflag = 0; 190 foreach (@skipdefs) { 191 #print "skipdbg: $_ =~ $rec\n" if $rec =~ /207/; 192 if ($rec =~ /\Q$_\E/) { 193 $skipflag = 1; 194 # print "skip: $rec\n"; 195 } 196 } 197 next if $skipflag; 198 186 199 ##fixme: use external skiplist 187 # skip stale records that have no value188 next if /^ip-192-168-1(12|20)-\d+/;189 next if /ip.add.re.\d+\s*$/;190 191 192 last if $i > 7;200 # # skip stale records that have no value 201 # next if /^ip-192-168-1(12|20)-\d+/; 202 # next if /ip.add.re.\d+\s*$/; 203 204 $i++; 205 last if $i > 17; 193 206 #print "line $i: ($rec)\n"; 194 207 if (my ($macro,$mdetail) = ($rec =~ /^\s*\$(TTL|ORIGIN|INCLUDE|GENERATE)\s+(.+)/) ) { … … 236 249 if ($rec =~ /^\s/) { 237 250 $curlabel = $prevlabel; 238 print " found empty label, using previous label\n";251 #print " found empty label, using previous label\n"; 239 252 } else { 240 253 ($curlabel) = ($rec =~ /^([\w\@_.-]+)\s/); 241 254 } 242 255 243 print " found '$curlabel'\n";256 #print " found '$curlabel'\n"; 244 257 245 258 # magic name! … … 250 263 $curlabel .= ($origin eq '.' ? '.' : ".$origin"); 251 264 } 252 print " expanded '$curlabel'\n";265 #print " expanded '$curlabel'\n"; 253 266 254 267 # hack pthbptt … … 476 489 #Zfqdn:mname:rname:ser:ref:ret:exp:min:ttl:timestamp:lo 477 490 #print "Z$zname:$ns:$adminmail:$soabits[0]:$soabits[1]:$soabits[2]:$soabits[3]:$soabits[4]:$ttl\n"; 491 # skip insert at end of loop; SOA records are not handled by DNSDB::addRec() 492 next; 478 493 } # SOA 479 494 … … 556 571 $location, undef, undef, $distance, $weight, $port); 557 572 } 558 print "$code: $msg\n" ;573 print "$code: $msg\n" if $code ne 'OK'; 559 574 } 560 575 # $i++;
Note:
See TracChangeset
for help on using the changeset viewer.