X-Git-Url: https://code.th-h.de/?p=usenet%2Fnewsstats.git;a=blobdiff_plain;f=NewsStats.pm;h=91a139621f82f2fc64c7a47ab1f76e2e5878db43;hp=bfcb37b2e3c7948cb5f02c8f89f4a7372deaaac2;hb=db7696e550695219f00b24b19020f0c163e8c171;hpb=1703b8e3b454713d4f873acdb5cb400db490a152 diff --git a/NewsStats.pm b/NewsStats.pm index bfcb37b..91a1396 100644 --- a/NewsStats.pm +++ b/NewsStats.pm @@ -99,7 +99,19 @@ sub ReadConfig { ### IN : $ConfFile: config filename ### OUT: reference to a hash containing the configuration my ($ConfFile) = @_; - return Config::Auto::parse($ConfFile, format => 'equal'); + # mandatory configuration options + my @Mandatory = ('DBDriver','DBHost','DBUser','DBPw','DBDatabase', + 'DBTableRaw','DBTableGrps'); + # read config via Config::Auto + my $ConfR = Config::Auto::parse($ConfFile, format => 'equal'); + my %Conf = %{$ConfR}; + # check for mandatory options + foreach (@Mandatory) { + &Bleat(2,sprintf("Mandatory configuration option %s is not set!",$_)) + if (!defined($Conf{$_})); + } + # $Conf{'TLH'} is checked in gatherstats.pl + return $ConfR; }; ################################################################################