Changeset 400 for trunk/cgi-bin/checkcusts.pl
- Timestamp:
- 05/11/10 17:06:26 (14 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/checkcusts.pl
r123 r400 7 7 # Last update by $Author$ 8 8 ### 9 # Copyright (C) 2004 Kris Deugau <kdeugau@vianet.ca>9 # Copyright (C) 2004-2006 Kris Deugau 10 10 11 11 use DBI; 12 use IPDB qw(:ALL);12 use IPDB 2.0 qw(:ALL); 13 13 14 14 # We'll be hosing the server with several thousand queries. We … … 25 25 print "Content-type: text/plain\n\n"; 26 26 27 $dbh = connectDB;27 ($dbh,$errstr) = connectDB("ipdb", "ipdb", "ipdbpwd"); 28 28 $IDH = DBI->connect ("DBI:Pg:host=billing;dbname=custids", "cidcheck", "c1dch4ck"); 29 30 $sth = $dbh->prepare("select distinct def_custid from alloctypes where listorder >=40"); 31 $sth->execute; 32 while (@data = $sth->fetchrow_array) { 33 push @def_custids, $data[0]; 34 } 29 35 $sth = $dbh->prepare("select cidr,custid from searchme where not (custid='6750400') ". 30 36 "and not (custid='STAFF') order by cidr"); 37 #$sth = $dbh->prepare("select cidr,custid from searchme order by cidr"); 31 38 $sth->execute; 32 39 … … 35 42 $count = $bad = 0; 36 43 while (@data = $sth->fetchrow_array) { 37 $count++;38 44 $cidr = new NetAddr::IP $data[0]; 39 if ($cidr->within($priv1) or $cidr->within($priv2) or $cidr->within($priv3)) { 45 if ($cidr->within($priv1) or $cidr->within($priv2) or $cidr->within($priv3) or 46 (grep /$data[1]/, @def_custids)) { 40 47 # no-op. we ignore these. 41 48 } else { 49 $count++; 42 50 $IDS->execute($data[1]); 43 51 $hr = $IDS->fetchrow_hashref();
Note:
See TracChangeset
for help on using the changeset viewer.