From 3942254e30e915f57d1496def3d58a29b054314e Mon Sep 17 00:00:00 2001 From: Christoph Klaffl Date: Fri, 20 Sep 2024 07:38:12 +0200 Subject: [PATCH] ignore duplicate template keys --- sanoid | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sanoid b/sanoid index f74f731..c2d2ebd 100755 --- a/sanoid +++ b/sanoid @@ -1008,6 +1008,12 @@ sub init { } if ($args{'debug'}) { print "DEBUG: overriding $key on $section with value from user-defined template $template.\n"; } $config{$section}{$key} = $ini{$template}{$key}; + + my $value = $config{$section}{$key}; + if (ref($value) eq 'ARRAY') { + # handle duplicates silently (warning was already printed above) + $config{$section}{$key} = $value->[0]; + } } } }