diff --git a/mrtg-rrd.cgi b/mrtg-rrd.cgi index 7e0f615..69b1458 100755 --- a/mrtg-rrd.cgi +++ b/mrtg-rrd.cgi @@ -728,12 +728,12 @@ sub try_read_config($) read_mrtg_config($cfgfile, \%defaults, $cfgref, \$order); } + parse_directories(); + delete $targets{'^'}; delete $targets{_}; delete $targets{'$'}; - parse_directories(); - $config_time = time; } @@ -852,6 +852,8 @@ sub parse_directories { # FIXME: the sort is expensive for my $name (sort { $targets{$a}{order} <=> $targets{$b}{order} } keys %targets) { + next if $name =~ /^[\$\^_]$/; + my $dir = $targets{$name}{directory} if defined $targets{$name}{directory}; $dir = '' unless defined $dir; @@ -869,6 +871,9 @@ sub parse_directories { $targets{$name}{config}; $directories{$prefix}{bodytag} = $targets{$name}{bodytag}; + $directories{$prefix}{addhead} = $targets{_}{addhead}; + $directories{$prefix}{pagetop} = $targets{_}{pagetop}; + $directories{$prefix}{pagefoot} = $targets{_}{pagefoot}; } $prefix .= $component . '/'; } @@ -877,6 +882,9 @@ sub parse_directories { $targets{$name}{config}; $directories{$dir}{bodytag} = $targets{$name}{bodytag}; + $directories{$dir}{addhead} = $targets{_}{addhead}; + $directories{$dir}{pagetop} = $targets{_}{pagetop}; + $directories{$dir}{pagefoot} = $targets{_}{pagefoot}; } push (@{$directories{$dir}{target}}, $name); @@ -894,9 +902,12 @@ sub print_dir($) {