X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApp%2FFonBot%2FPlugin%2FConfig.pm;h=877bf29ba2d9891cef1aea2347962c271e1439fe;hb=refs%2Fheads%2Fmaster;hp=b710cf86d412b0859b4e6c95f122d12cc5a26b01;hpb=8dc70d07c47947a1b1a9de7d377aee1003aca0ae;p=app-fonbot-daemon.git diff --git a/lib/App/FonBot/Plugin/Config.pm b/lib/App/FonBot/Plugin/Config.pm index b710cf8..877bf29 100644 --- a/lib/App/FonBot/Plugin/Config.pm +++ b/lib/App/FonBot/Plugin/Config.pm @@ -1,6 +1,6 @@ package App::FonBot::Plugin::Config; -our $VERSION = '0.000_3'; +our $VERSION = '0.001'; use v5.14; use strict; @@ -11,28 +11,30 @@ use parent qw/Exporter/; use Apache2::Authen::Passphrase; use Log::Log4perl qw//; -our @EXPORT_OK=qw/$oftc_enabled $oftc_nick @oftc_channels $oftc_nickserv_password $bitlbee_enabled $bitlbee_nick $bitlbee_server $bitlbee_port $bitlbee_password $dir $user $group @supplementary_groups $httpd_port/; +our @EXPORT_OK=qw/$oftc_enabled $oftc_nick @oftc_channels $oftc_nickserv_password $bitlbee_enabled $bitlbee_nick $bitlbee_server $bitlbee_port $bitlbee_password $dir $user $group @supplementary_groups $httpd_port $email_batch_seconds $email_from $email_subject/; ################################################## our ($oftc_enabled, $oftc_nick, @oftc_channels, $oftc_nickserv_password); our ($bitlbee_enabled, $bitlbee_nick, $bitlbee_server, $bitlbee_port, $bitlbee_password); our ($dir, $user, $group, @supplementary_groups); +our ($httpd_port); +our ($email_batch_seconds, $email_from, $email_subject); ################################################## my $log=Log::Log4perl->get_logger(__PACKAGE__); sub init{ - $log->info('reading config file'); - unless (my $ret = do '/etc/fonbotd/config.pl') { - die "Cannot parse config file: $@" if $@; - die "Cannot run config file: $!" unless $ret; - } + $log->info('reading config file'); + unless (my $ret = do '/etc/fonbotd/config.pl') { + die "Cannot parse config file: $@" if $@; + die "Cannot run config file: $!" unless $ret; + } } sub fini{ - #no-op + #no-op } 1; @@ -47,29 +49,34 @@ App::FonBot::Plugin::Config - FonBot plugin for reading configuration files =head1 SYNOPSIS - use App::FonBot::Plugin::Config qw/$oftc_enabled $oftc_nick @oftc_channels $oftc_nickserv_password $bitlbee_enabled $bitlbee_nick $bitlbee_server $bitlbee_port $bitlbee_password $user $group @supplementary_groups $httpd_port/; - App::FonBot::Plugin::Config->init; + use App::FonBot::Plugin::Config qw/$oftc_enabled $oftc_nick @oftc_channels $oftc_nickserv_password $bitlbee_enabled $bitlbee_nick $bitlbee_server $bitlbee_port $bitlbee_password $user $group @supplementary_groups $httpd_port/; + App::FonBot::Plugin::Config->init; - # Variables used in App::FonBot:Plugin::OFTC - say "The OFTC plugin is ".($oftc_enabled ? 'enabled' : 'disabled'); - say "The OFTC NickServ password is $oftc_nickserv_password"; - say "The OFTC nickname is $oftc_nick"; - say "The OFTC channels are @oftc_channels"; + # Variables used in App::FonBot:Plugin::OFTC + say "The OFTC plugin is ".($oftc_enabled ? 'enabled' : 'disabled'); + say "The OFTC NickServ password is $oftc_nickserv_password"; + say "The OFTC nickname is $oftc_nick"; + say "The OFTC channels are @oftc_channels"; - # Variables used in App::FonBot::Plugin::BitlBee - say "The BitlBee plugin is ".($bitlbee_enabled ? 'enabled' : 'disabled'); - say "The BitlBee server runs on port $bitlbee_port of host $bitlbee_server" - say "The BitlBee nickname is $bitlbee_nick"; - say "The BitlBee password is $bitlbee_password"; + # Variables used in App::FonBot::Plugin::BitlBee + say "The BitlBee plugin is ".($bitlbee_enabled ? 'enabled' : 'disabled'); + say "The BitlBee server runs on port $bitlbee_port of host $bitlbee_server" + say "The BitlBee nickname is $bitlbee_nick"; + say "The BitlBee password is $bitlbee_password"; - # Variables used in App::FonBot::Plugin::Common - say "The storage directory is $dir"; - say "The user is $user"; - say "The primary group is $group"; - say "The supplementary groups are @supplementary_groups"; + # Variables used in App::FonBot::Plugin::Common + say "The storage directory is $dir"; + say "The user is $user"; + say "The primary group is $group"; + say "The supplementary groups are @supplementary_groups"; - # Variables used in App::FonBot::Plugin::HTTPD - say "The HTTPD listens on port $httpd_port" + # Variables used in App::FonBot::Plugin::HTTPD + say "The HTTPD listens on port $httpd_port" + + # Variables used in App::FonBot::Plugin::Email + say "The email batch delay is $email_batch_seconds"; + say "The email plugin sends emails from $email_from"; + say "The email plugin sends emails with subject $email_subject"; =head1 DESCRIPTION @@ -97,7 +104,7 @@ Marius Gavrilescu C<< >> =head1 COPYRIGHT AND LICENSE -Copyright 2013 Marius Gavrilescu +Copyright 2013-2015 Marius Gavrilescu This file is part of fonbotd.