Skip to content
Snippets Groups Projects
Commit 18dd8ba1 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Pull radius plugin config direct from config hash

parent 0f12afef
No related branches found
No related tags found
No related merge requests found
...@@ -80,17 +80,30 @@ sub init ...@@ -80,17 +80,30 @@ sub init
$logger->log(LOG_NOTICE,"[RADIUS] OpenTrafficShaper Radius Module v".VERSION." - Copyright (c) 2013, AllWorldIT"); $logger->log(LOG_NOTICE,"[RADIUS] OpenTrafficShaper Radius Module v".VERSION." - Copyright (c) 2013, AllWorldIT");
#
# Dictionary configuration
#
# Split off dictionaries to load
if (ref($globals->{'file.config'}->{'plugin.radius'}->{'dictionary'}) eq "ARRAY") {
foreach my $dict (@{$globals->{'file.config'}->{'plugin.radius'}->{'dictionary'}}) {
$dict =~ s/\s+//g;
# Skip comments
next if ($dict =~ /^#/);
push(@{$globals->{'plugin.radius'}->{'config'}->{'dictionaries'}},$dict);
}
}
# Load dictionaries # Load dictionaries
$logger->log(LOG_INFO,"[RADIUS] Loading dictionaries..."); $logger->log(LOG_DEBUG,"[RADIUS] Loading dictionaries...");
my $dict = new opentrafficshaper::plugins::radius::Radius::Dictionary; my $dict = new opentrafficshaper::plugins::radius::Radius::Dictionary;
foreach my $df (@{$globals->{'config'}->{'dictionary_list'}}) { foreach my $df (@{$globals->{'plugin.radius'}->{'config'}->{'dictionaries'}}) {
# Load dictionary # Load dictionary
if (!$dict->readfile($df)) { if (!$dict->readfile($df)) {
$logger->log(LOG_WARN,"[RADIUS] Failed to load dictionary '$df': $!"); $logger->log(LOG_WARN,"[RADIUS] Failed to load dictionary '$df': $!");
} }
$logger->log(LOG_DEBUG,"[RADIUS] Loaded dictionary '$df'."); $logger->log(LOG_INFO,"[RADIUS] Loaded dictionary '$df'.");
} }
$logger->log(LOG_INFO,"[RADIUS] Loading dictionaries completed."); $logger->log(LOG_DEBUG,"[RADIUS] Loading dictionaries completed.");
# Store the dictionary # Store the dictionary
$globals->{'plugin.radius'}->{'dictionary'} = $dict; $globals->{'plugin.radius'}->{'dictionary'} = $dict;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment