summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Pro <43214013+daniel-pro@users.noreply.github.com>2019-01-21 21:52:38 +0100
committerGitHub <noreply@github.com>2019-01-21 21:52:38 +0100
commit66234e39e21c79934c7c7a21b6d83addbbb6e482 (patch)
treea63979cdb1162449fba48860523a4a7429c5c384
parent9df8abe49b2e5c7a23f7d2344a9be92a978bc998 (diff)
downloadvyatta-cfg-system-66234e39e21c79934c7c7a21b6d83addbbb6e482.tar.gz
vyatta-cfg-system-66234e39e21c79934c7c7a21b6d83addbbb6e482.zip
T1172: vyatta_update_sysctl.pl does not support options that have multiple values
Updated vyatta_update_sysctl.pl, now handles multiple values
-rw-r--r--scripts/system/vyatta_update_sysctl.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/system/vyatta_update_sysctl.pl b/scripts/system/vyatta_update_sysctl.pl
index 6e33c5d0..adc84178 100644
--- a/scripts/system/vyatta_update_sysctl.pl
+++ b/scripts/system/vyatta_update_sysctl.pl
@@ -51,18 +51,19 @@ EOF
}
GetOptions(
- "option=s{2}" => \@opts,
+ "option=s{2,}" => \@opts,
) or usage();
set_sysctl_value(@opts) if (@opts);
exit 0;
sub set_sysctl_value {
- my ($sysctl_opt, $nvalue) = @_;
+ my ($sysctl_opt, @nvaluearr) = @_;
+ my $nvalue = join ' ',@nvaluearr;
my $ovalue = get_sysctl_value($sysctl_opt);
if ($nvalue ne $ovalue) {
- my $cmd = "$SYSCTL -w $sysctl_opt=$nvalue 2>&1> /dev/null";
+ my $cmd = "$SYSCTL -w $sysctl_opt=\"$nvalue\" 2>&1> /dev/null";
system($cmd);
if ($? >> 8) {
die "exec of $SYSCTL failed: '$cmd'";