Merge branch 'thh-bug51' into next
[usenet/newsstats.git] / bin / feedlog.pl
index ef9429c..bbfd814 100755 (executable)
@@ -4,12 +4,12 @@
 #
 # This script will log headers and other data to a database
 # for further analysis by parsing a feed from INN.
 #
 # This script will log headers and other data to a database
 # for further analysis by parsing a feed from INN.
-# 
+#
 # It is part of the NewsStats package.
 #
 # Copyright (c) 2010-2013 Thomas Hochstein <thh@inter.net>
 #
 # It is part of the NewsStats package.
 #
 # Copyright (c) 2010-2013 Thomas Hochstein <thh@inter.net>
 #
-# It can be redistributed and/or modified under the same terms under 
+# It can be redistributed and/or modified under the same terms under
 # which Perl itself is published.
 
 BEGIN {
 # which Perl itself is published.
 
 BEGIN {
@@ -69,14 +69,15 @@ sub PrepareDB {
 ################################# Main program #################################
 
 ### read commandline options
 ################################# Main program #################################
 
 ### read commandline options
-my ($OptDebug,$OptQuiet);
+my ($OptDebug,$OptQuiet,$OptConfFile);
 GetOptions ('d|debug!'        => \$OptDebug,
             'q|test!'         => \$OptQuiet,
 GetOptions ('d|debug!'        => \$OptDebug,
             'q|test!'         => \$OptQuiet,
+            'conffile=s'      => \$OptConfFile,
             'h|help'          => \&ShowPOD,
             'V|version'       => \&ShowVersion) or exit 1;
 
 ### read configuration
             'h|help'          => \&ShowPOD,
             'V|version'       => \&ShowVersion) or exit 1;
 
 ### read configuration
-my %Conf = %{ReadConfig('')};
+my %Conf = %{ReadConfig($OptConfFile)};
 
 ### init syslog
 openlog($0, 'nofatal,pid', LOG_NEWS);
 
 ### init syslog
 openlog($0, 'nofatal,pid', LOG_NEWS);
@@ -130,7 +131,7 @@ while (<>) {
     };
   };
   $DBQuery->finish;
     };
   };
   $DBQuery->finish;
-  
+
   warn sprintf("-----\nDay: %s\nDate: %s\nMID: %s\nTS: %s\nToken: %s\n".
                "Size: %s\nPeer: %s\nPath: %s\nNewsgroups: %s\nHeaders: %s\n",
                $Day, $Date, $Mid, $Timestamp, $Token, $Size, $Peer, $Path,
   warn sprintf("-----\nDay: %s\nDate: %s\nMID: %s\nTS: %s\nToken: %s\n".
                "Size: %s\nPeer: %s\nPath: %s\nNewsgroups: %s\nHeaders: %s\n",
                $Day, $Date, $Mid, $Timestamp, $Token, $Size, $Peer, $Path,
@@ -152,7 +153,7 @@ feedlog - log data from an INN feed to a database
 
 =head1 SYNOPSIS
 
 
 =head1 SYNOPSIS
 
-B<feedlog> [B<-Vhdq>]
+B<feedlog> [B<-Vhdq>] [--conffile I<filename>]
 
 =head1 REQUIREMENTS
 
 
 =head1 REQUIREMENTS
 
@@ -198,6 +199,10 @@ find that information most probably in your B<INN> F<errlog> file.
 
 Suppress logging to syslog.
 
 
 Suppress logging to syslog.
 
+=item B<--conffile> I<filename>
+
+Load configuration from I<filename> instead of F<newsstats.conf>.
+
 =back
 
 =head1 INSTALLATION
 =back
 
 =head1 INSTALLATION
This page took 0.011344 seconds and 4 git commands to generate.