Last change
on this file since 7 was 2, checked in by Kris Deugau, 15 years ago |
/trunk/dnsbl
Import work to date
|
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Date Rev Author Id
|
File size:
699 bytes
|
Line | |
---|
1 | #!/usr/bin/perl
|
---|
2 | # move blocks listed with one org to another. intended for orgs that have several bytestrings as names in WHOIS.
|
---|
3 |
|
---|
4 | use strict;
|
---|
5 | use warnings;
|
---|
6 | use DBI;
|
---|
7 |
|
---|
8 | use DNSBL;
|
---|
9 |
|
---|
10 | my $dnsbl = new DNSBL;
|
---|
11 |
|
---|
12 | my $dbh = $dnsbl->connect;
|
---|
13 |
|
---|
14 | $dbh->{AutoCommit} = 0;
|
---|
15 |
|
---|
16 | my $sth1 = $dbh->prepare("update blocks set orgid=? where orgid=?");
|
---|
17 | my $sth2 = $dbh->prepare("delete from orgs where orgid=?");
|
---|
18 |
|
---|
19 | print "updating orgid $ARGV[0] to $ARGV[1]...\n";
|
---|
20 | $sth1->execute($ARGV[1],$ARGV[0]) or die "died horribly: $!\n";
|
---|
21 | print "failed org change ($ARGV[0] -> $ARGV[1]): ".$sth1->errstr."\n" if $sth1->err;
|
---|
22 | $sth2->execute($ARGV[0]);
|
---|
23 | print "failed org delete ($ARGV[0]): ".$sth2->errstr."\n" if $sth2->err;
|
---|
24 |
|
---|
25 | $dbh->commit;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.