source: trunk/dnsbl/orgmove@ 7

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
4use strict;
5use warnings;
6use DBI;
7
8use DNSBL;
9
10my $dnsbl = new DNSBL;
11
12my $dbh = $dnsbl->connect;
13
14$dbh->{AutoCommit} = 0;
15
16my $sth1 = $dbh->prepare("update blocks set orgid=? where orgid=?");
17my $sth2 = $dbh->prepare("delete from orgs where orgid=?");
18
19print "updating orgid $ARGV[0] to $ARGV[1]...\n";
20$sth1->execute($ARGV[1],$ARGV[0]) or die "died horribly: $!\n";
21print "failed org change ($ARGV[0] -> $ARGV[1]): ".$sth1->errstr."\n" if $sth1->err;
22$sth2->execute($ARGV[0]);
23print "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.