Changeset 80 for trunk/uribl/export-uridb
- Timestamp:
- 09/11/25 16:28:23 (3 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/uribl/export-uridb
r41 r80 3 3 ## 4 4 # $Id$ 5 # Copyright 2010 Kris Deugau <kdeugau@deepnet.cx>5 # Copyright 2010,2025 Kris Deugau <kdeugau@deepnet.cx> 6 6 # 7 7 # This program is free software: you can redistribute it and/or modify … … 23 23 use DBI; 24 24 25 use URIdb; 25 # push "the directory the script is in" into @INC 26 use FindBin; 27 use lib "$FindBin::RealBin/"; 28 29 use URIdb 2.0; 26 30 27 31 my $uridb = new URIdb; 28 32 29 # default DB info - all other settings should be loaded from the DB. 30 my $dbhost = "localhost"; 31 my $dbname = "uridb"; 32 my $dbuser = "uridb"; 33 my $dbpass = "spambgone"; 33 die "Usage: export-uridb <list> [type]\n" 34 if !$ARGV[0]; 34 35 35 warn "Need DNS data type argument\n" if !$ARGV[0]; 36 my $cfgname = shift @ARGV; 37 38 warn "Missing DNS data type argument, defaulting to rbldnsd\n" if !$ARGV[0]; 36 39 my $mode = shift @ARGV || 'rbldnsd'; 37 40 38 # Load a config ref containing DB host, name, user, and pass info based on 39 # from the server name + full script web path. This allows us to host 40 # multiple instances without having to duplicate the code. 41 # This file is a Perl fragment to be processed inline. 42 if (-e "/etc/uridb/uridb.conf") { 43 my $cfg = `cat /etc/uridb/uridb.conf`; 44 ($cfg) = ($cfg =~ /^(.+)$/s); # avoid warnings, failures, and general nastiness with taint mode 45 eval $cfg; 46 } 47 48 my $dbh = $uridb->connect($dbhost, $dbname, $dbuser, $dbpass); 41 my $uridb = new URIdb (configfile => "/etc/uridb/$cfgname.conf"); 42 $uridb->connect; 49 43 50 44 my %config;
Note:
See TracChangeset
for help on using the changeset viewer.