Allow config options to be used as shell variables

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2011-12-15 12:52:22 -08:00
parent 10d10b1c16
commit 9d66f34932

View File

@ -1933,9 +1933,11 @@ sub expand_variables( \$ ) {
if ( $var =~ /^\d+$/ ) {
fatal_error "Undefined parameter (\$$var)" unless $var > 0 && defined $actparms[$var];
$val = $actparms[$var];
} else {
fatal_error "Undefined shell variable (\$$var)" unless exists $params{$var};
} elsif ( exists $params{$var} ) {
$val = $params{$var};
} else {
fatal_error "Undefined shell variable (\$$var)" unless exists $config{$var};
$val = $config{$var};
}
$val = '' unless defined $val;