From 2417beb2704877405cc75ed7e7d041d775f29155 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 6 Jun 2016 18:57:03 +0200 Subject: [PATCH] Don't force Letsencrypt support on primary domain --- .../templates/etc/letsencrypt.sh/domains.txt/10domains | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 9f2669e..9033a14 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 @@ -7,12 +7,17 @@ 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"; -my @names = ( "$DomainName" ); +my @names = (); foreach my $domain ($d->domains, $d->get_all_by_prop(type => 'vhost')){ - next if ($domain->key eq $DomainName); my $le = $domain->prop('Letsencrypt') || 'enabled'; - push @names, $domain->key unless $le ne 'enabled'; + next if ($le ne 'enabled'); + if ($domain->key eq $DomainName){ + unshift @names, $DomainName; + } + else{ + push @names, $domain->key; + } } foreach my $host ($h->hosts){