Better AltName selection and deduplication

tags/smeserver-letsencrypt-client-0.2.4-1 0.1.4_el5
Daniel Berteaud 9 years ago
parent 4fb5dd3018
commit bae34ca9f1
  1. 5
      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));
}

Loading…
Cancel
Save