From ac919a733a5e7b27472d69b433447406310f2144 Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Thu, 21 Jul 2016 00:02:55 +0200 Subject: sboconfig: Just pass in all %changes to config_write() --- sboconfig | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'sboconfig') diff --git a/sboconfig b/sboconfig index f3bba1d..a621207 100755 --- a/sboconfig +++ b/sboconfig @@ -135,6 +135,7 @@ sub config_write { while (@_ >= 2) { my $key = shift; my $val = shift; + say "Setting $key to $val..."; if ($conf =~ /^\Q$key\E=/m) { $conf =~ s/^\Q$key\E=.*$/$key=$val/m; @@ -177,10 +178,6 @@ sub _fixup_conf { $_[0] = join "\n", @fixed, ''; # make sure we end with a newline if there are any lines } -for my $key (keys %changes) { - my $value = $changes{$key}; - say "Setting $key to $value..."; - config_write($key, $value); -} +config_write(%changes) if %changes; exit 0; -- cgit v1.2.3