diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-07-21 00:02:55 +0200 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-07-21 00:02:55 +0200 |
commit | ac919a733a5e7b27472d69b433447406310f2144 (patch) | |
tree | 6c06b914e128f0ad9fe32f2fc7f45b68bab9e461 /sboconfig | |
parent | f211e8fd7f05d035f473056c4b1a63c617e472e3 (diff) | |
download | sbotools-ac919a733a5e7b27472d69b433447406310f2144.tar.xz |
sboconfig: Just pass in all %changes to config_write()
Diffstat (limited to 'sboconfig')
-rwxr-xr-x | sboconfig | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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; |