aboutsummaryrefslogtreecommitdiff
path: root/idalius.pl
diff options
context:
space:
mode:
Diffstat (limited to 'idalius.pl')
-rwxr-xr-xidalius.pl17
1 files changed, 12 insertions, 5 deletions
diff --git a/idalius.pl b/idalius.pl
index 627d91f..d6b0c06 100755
--- a/idalius.pl
+++ b/idalius.pl
@@ -23,14 +23,11 @@ sub log_info {
print "$stamp | @_\n";
}
+Plugin::set_load_callback(\&module_loaded_callback);
+
eval {
for my $module (@{$config->{_}->{plugins}}) {
Plugin::load_plugin(\&log_info, $config->{_}, $module);
- $module->configure(
- \&register_command,
- \&run_command,
- $config->{$module},
- $config->{_});
}
1;
} or do {
@@ -85,6 +82,16 @@ drop_priv();
$poe_kernel->run();
+sub module_loaded_callback {
+ my ($module) = @_;
+
+ $module->configure(
+ \&register_command,
+ \&run_command,
+ $config->{$module},
+ $config->{_});
+}
+
sub module_is_enabled {
my $module = $_[0];