Skip to content
Snippets Groups Projects
Commit 91e625a0 authored by Mark Harrison's avatar Mark Harrison
Browse files

Allow wildcard includes (e.g. INCLUDE conf/*.conf)

git-svn-id: https://labs.omniti.com/resmon/branches/resmon2@369 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55
parent ab637c17
No related branches found
No related tags found
No related merge requests found
......@@ -109,11 +109,16 @@ sub new {
$self->{authpass} = $1;
next;
} elsif(/\s*INCLUDE\s+(\S+)\s*;\s*/) {
my $incfilename = $1;
my $incglob = $1;
# Apply percent substitutions
my $HOSTNAME = hostname; # Uses Sys::Hostname
$incfilename =~ s/%h/$HOSTNAME/g;
$incfilename =~ s/%o/$^O/g;
new($class, $incfilename, $self);
$incglob =~ s/%h/$HOSTNAME/g;
$incglob =~ s/%o/$^O/g;
foreach my $incfilename (glob $incglob) {
new($class, $incfilename, $self);
}
} else {
die "Syntax Error in config file $filename on line $line\n";
}
......
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