From 981dd5f333f9f2a9430e65a2ccc0c09e0a05d3f1 Mon Sep 17 00:00:00 2001 From: Lenard Hess Date: Tue, 19 Mar 2024 21:55:46 +0100 Subject: [PATCH] Fixed _env suffixed config variables causing errors in check_value() --- ddclient.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ddclient.in b/ddclient.in index ddb5d8b..d28f4f4 100755 --- a/ddclient.in +++ b/ddclient.in @@ -1852,6 +1852,9 @@ sub init_config { ## make sure config entries have all defaults and they meet minimums ## first the globals... foreach my $k (keys %globals) { + # Make sure any _env suffixed variables look at their original entry + $k = $1 if $k =~ /^(.*)_env$/; + my $def = $variables{'merged'}{$k}; my $ovalue = $globals{$k} // $def->{'default'}; my $value = check_value($ovalue, $def); @@ -1881,6 +1884,9 @@ sub init_config { my $conf = { 'protocol' => $proto }; foreach my $k (keys %$svars) { + # Make sure any _env suffixed variables look at their original entry + $k = $1 if $k =~ /^(.*)_env$/; + my $def = $svars->{$k}; my $ovalue = $config{$h}{$k} // $def->{'default'}; my $value = check_value($ovalue, $def);