feat: crash if template can't be found

Signed-off-by: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com>
This commit is contained in:
thiswillbeyourgithub 2025-09-16 14:52:52 +02:00
parent dbcaeef1ac
commit f5ac493bbd
1 changed files with 6 additions and 0 deletions

6
sanoid
View File

@ -1020,6 +1020,12 @@ sub init {
$rawtemplate =~ s/\s+$//g;
my $template = 'template_'.$rawtemplate;
# Check if template exists
if (!exists $ini{$template}) {
die "FATAL ERROR: Template '$rawtemplate' referenced in section [$section] does not exist in $conf_file.\n";
}
foreach my $key (keys %{$ini{$template}}) {
if ($key =~ /template|recursive/) {
warn "ignored key '$key' from '$rawtemplate' template.\n";