diff --git a/root/etc/e-smith/templates/etc/letsencrypt.sh/domains.txt/10domains b/root/etc/e-smith/templates/etc/letsencrypt.sh/domains.txt/10domains index 22a8edb..9f2669e 100644 --- a/root/etc/e-smith/templates/etc/letsencrypt.sh/domains.txt/10domains +++ b/root/etc/e-smith/templates/etc/letsencrypt.sh/domains.txt/10domains @@ -2,6 +2,7 @@ use esmith::DomainsDB; use esmith::HostsDB; +use List::MoreUtils qw(uniq); my $d = esmith::DomainsDB->open_ro || die "Couldn't open DomainsDB\n"; my $h = esmith::HostsDB->open_ro || die "Couldn't open HostsDB\n"; @@ -22,12 +23,12 @@ foreach my $host ($h->hosts){ } my $type = $host->prop('HostType') || 'Self'; my $le = $host->prop('Letsencrypt') || 'default'; - if ($le =~ m/^enabled|yes|1|on$/i || + if ((($le =~ m/^enabled|yes|1|on$/i) && (($d->get_prop($d, 'Letsencrypt') || 'enabled') eq 'enabled')) || ($type eq 'Self' && $dom eq $DomainName) && ($le !~ m/^disabled|no|0|off$/)){ push @names, $host->key; } } -$OUT .= join(" ", @names); +$OUT .= join(" ", uniq(@names)); }