Changeset 91e625a0f01031ada5a64b416624804aea5cd439

Show
Ignore:
Timestamp:
05/12/10 15:24:44 (5 years ago)
Author:
Mark Harrison <mark@omniti.com>
git-committer:
Mark Harrison <mark@omniti.com> 1273677884 +0000
git-parent:

[ab637c1792a4b0a60d352968204b4b73999f7d99]

git-author:
Mark Harrison <mark@omniti.com> 1273677884 +0000
Message:

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

git-svn-id: https://labs.omniti.com/resmon/branches/resmon2@369 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lib/Resmon/Config.pm

    r72ec062 r91e625a  
    110110                next; 
    111111            } elsif(/\s*INCLUDE\s+(\S+)\s*;\s*/) { 
    112                 my $incfilename = $1; 
     112                my $incglob = $1; 
     113 
     114                # Apply percent substitutions 
    113115                my $HOSTNAME = hostname; # Uses Sys::Hostname 
    114                 $incfilename =~ s/%h/$HOSTNAME/g; 
    115                 $incfilename =~ s/%o/$^O/g; 
    116                 new($class, $incfilename, $self); 
     116                $incglob =~ s/%h/$HOSTNAME/g; 
     117                $incglob =~ s/%o/$^O/g; 
     118 
     119                foreach my $incfilename (glob $incglob) { 
     120                    new($class, $incfilename, $self); 
     121                } 
    117122            } else { 
    118123                die "Syntax Error in config file $filename on line $line\n";