mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-03 00:15:54 +02:00
Allow variable expansion when processing shorewallrc.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
e626b77097
commit
60f2f3b0d0
@ -4075,14 +4075,16 @@ sub process_shorewallrc( $$ ) {
|
|||||||
my ( $shorewallrc , $product ) = @_;
|
my ( $shorewallrc , $product ) = @_;
|
||||||
|
|
||||||
$shorewallrc{PRODUCT} = $product;
|
$shorewallrc{PRODUCT} = $product;
|
||||||
|
$variables{PRODUCT} = $product;
|
||||||
|
|
||||||
if ( open_file $shorewallrc ) {
|
if ( open_file $shorewallrc ) {
|
||||||
while ( read_a_line( STRIP_COMMENTS | SUPPRESS_WHITESPACE | CHECK_GUNK ) ) {
|
while ( read_a_line( STRIP_COMMENTS | SUPPRESS_WHITESPACE | CHECK_GUNK | EXPAND_VARIABLES ) ) {
|
||||||
if ( $currentline =~ /^([a-zA-Z]\w*)=(.*)$/ ) {
|
if ( $currentline =~ /^([a-zA-Z]\w*)=(.*)$/ ) {
|
||||||
my ($var, $val) = ($1, $2);
|
my ($var, $val) = ($1, $2);
|
||||||
$val = $1 if $val =~ /^\"([^\"]*)\"$/;
|
$val = $1 if $val =~ /^\"([^\"]*)\"$/;
|
||||||
expand_shorewallrc_variables($val) if supplied $val;
|
expand_shorewallrc_variables($val) if supplied $val;
|
||||||
$shorewallrc{$var} = $val;
|
$shorewallrc{$var} = $val;
|
||||||
|
$variables{$var} = $val;
|
||||||
} else {
|
} else {
|
||||||
fatal_error "Unrecognized shorewallrc entry";
|
fatal_error "Unrecognized shorewallrc entry";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user