Changeset 25 for trunk/dnsbl/orgmove


Ignore:
Timestamp:
09/03/10 15:18:51 (14 years ago)
Author:
Kris Deugau
Message:

/trunk/dnsbl

Changes across the board to support multi-instance without code changes.
DB config is now loaded from a fragment in /etc/dnsbl, and the DB in turn
contains the autolist thresholds and some visual sugar for the web
interface so you know which DB you're dealing with.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dnsbl/orgmove

    r2 r25  
    1010my $dnsbl = new DNSBL;
    1111
    12 my $dbh = $dnsbl->connect;
     12# default DB info - all other settings should be loaded from the DB.
     13my $dbhost = "localhost";
     14my $dbname = "dnsbl";
     15my $dbuser = "dnsbl";
     16my $dbpass = "spambgone";
     17
     18die "Usage: orgmove <config name> <old orgid> <new orgid>\n" if !$ARGV[2];
     19my $cfgname = shift @ARGV;
     20
     21# Load a config ref containing DB host, name, user, and pass info based on
     22# from the server name + full script web path.  This allows us to host
     23# multiple instances without having to duplicate the code.
     24# This file is a Perl fragment to be processed inline.
     25if (-e "/etc/dnsbl/$cfgname.conf") {
     26  my $cfg = `cat /etc/dnsbl/$cfgname.conf`;
     27  ($cfg) = ($cfg =~ /^(.+)$/s);         # avoid warnings, failures, and general nastiness with taint mode
     28  eval $cfg;
     29}
     30
     31my $dbh = $dnsbl->connect($dbhost, $dbname, $dbuser, $dbpass);
    1332
    1433$dbh->{AutoCommit} = 0;
Note: See TracChangeset for help on using the changeset viewer.