From 66234e39e21c79934c7c7a21b6d83addbbb6e482 Mon Sep 17 00:00:00 2001 From: Daniel Pro <43214013+daniel-pro@users.noreply.github.com> Date: Mon, 21 Jan 2019 21:52:38 +0100 Subject: T1172: vyatta_update_sysctl.pl does not support options that have multiple values Updated vyatta_update_sysctl.pl, now handles multiple values --- scripts/system/vyatta_update_sysctl.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') 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'"; -- cgit v1.2.3