forked from extern/shorewall_code
Make new get_params work with bash
This commit is contained in:
parent
22580c5be0
commit
49cdc5d9eb
@ -2907,6 +2907,21 @@ sub get_params() {
|
|||||||
|
|
||||||
my $variable;
|
my $variable;
|
||||||
|
|
||||||
|
if ( $params[0] =~ /^declare/ ) {
|
||||||
|
for ( @params ) {
|
||||||
|
if ( /^declare -x (.*?)="(.*)"$/ ) {
|
||||||
|
$params{$1} = $2 unless $1 eq '_';
|
||||||
|
} elsif ( /^declare -x (.*?)="(.*)$/ ) {
|
||||||
|
$params{$variable=$1}="${2}\n";
|
||||||
|
} elsif ( /^declare -x (.*)\s+$/ ) {
|
||||||
|
$params{$1} = '';
|
||||||
|
} else {
|
||||||
|
assert($variable);
|
||||||
|
s/'$//;
|
||||||
|
$params{$variable} .= $_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
for ( @params ) {
|
for ( @params ) {
|
||||||
if ( /^export (.*?)='(.*)'$/ ) {
|
if ( /^export (.*?)='(.*)'$/ ) {
|
||||||
$params{$1} = $2 unless $1 eq '_';
|
$params{$1} = $2 unless $1 eq '_';
|
||||||
@ -2914,9 +2929,11 @@ sub get_params() {
|
|||||||
$params{$variable=$1}="${2}\n";
|
$params{$variable=$1}="${2}\n";
|
||||||
} else {
|
} else {
|
||||||
assert($variable);
|
assert($variable);
|
||||||
|
s/'$//;
|
||||||
$params{$variable} .= $_;
|
$params{$variable} .= $_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( $debug ) {
|
if ( $debug ) {
|
||||||
print "PARAMS:\n";
|
print "PARAMS:\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user