Index: trunk/uribl/import-cur.pl
===================================================================
--- trunk/uribl/import-cur.pl	(revision 83)
+++ trunk/uribl/import-cur.pl	(revision 84)
@@ -3,5 +3,5 @@
 ##
 # $Id$
-# Copyright 2010 Kris Deugau <kdeugau@deepnet.cx>
+# Copyright 2010,2025 Kris Deugau <kdeugau@deepnet.cx>
 # 
 #    This program is free software: you can redistribute it and/or modify
@@ -23,25 +23,16 @@
 use DBI;
 
-use URIdb;
+# push "the directory the script is in" into @INC
+use FindBin;
+use lib "$FindBin::RealBin/";
 
-my $uridb = new URIdb;
+use URIdb 2.0;
 
-# default DB info - all other settings should be loaded from the DB.
-my $dbhost = "localhost";
-my $dbname = "uridb";
-my $dbuser = "uridb";
-my $dbpass = "spambgone";
+die "Usage: import-cur.pl <list>\n"
+	if !$ARGV[0]
 
-# Load a config ref containing DB host, name, user, and pass info based on
-# from the server name + full script web path.  This allows us to host
-# multiple instances without having to duplicate the code.
-# This file is a Perl fragment to be processed inline.
-if (-e "/etc/uridb/uridb.conf") {
-  my $cfg = `cat /etc/uridb/uridb.conf`;
-  ($cfg) = ($cfg =~ /^(.+)$/s);         # avoid warnings, failures, and general nastiness with taint mode
-  eval $cfg;
-}
+my $cfgname = shift @ARGV;
 
-my $dbh = $uridb->connect($dbhost, $dbname, $dbuser, $dbpass);
+my $dbh = $uridb->connect(configfile => "/etc/uridb/$cfgname.conf");
 
 my $datesth = $dbh->prepare("UPDATE urilist SET added=? WHERE uri=?");
@@ -53,4 +44,5 @@
   $config{$key} = $value;
 }
+$config{blzone} = 'uribl.company.com' if !$config{blzone};
 
 my @months = ('null','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
@@ -83,5 +75,5 @@
   my ($domain,$list,$rest) = split /:/;
   ($list) = ($list =~ /\.(\d+)$/);
-  $domain =~ s/\.uribl\.company\.com$//;
+  $domain =~ s/$config{blzone}$//;
   if (!$uridb->exists($domain)) {
     print "adding $domain, $list\n";
