From 1f8df0ca48c1fa1186f2619c80dbbd9aa12c47a5 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 25 Jun 2018 16:29:24 +0200 Subject: [PATCH] Check if all specified domains are configured --- bin/letsencrypt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/letsencrypt b/bin/letsencrypt index 6a5c470..a73c269 100644 --- a/bin/letsencrypt +++ b/bin/letsencrypt @@ -324,6 +324,7 @@ if (Command::$result != EX_SUCCESS) { // check, issue and setup certificates $notifications = []; +$domains = []; foreach ((array) $config['certificates'] as $certificate) { @@ -341,6 +342,8 @@ foreach ((array) $config['certificates'] as $certificate) { $domainNames = array_keys($domainsMap); $domainPaths = array_values($domainsMap); + $domains += $domainNames; + // skip if domains omitted in the certificates argument if ($config['only'] && ! array_intersect($domainNames, $config['only'])) { @@ -477,6 +480,11 @@ foreach ((array) $config['certificates'] as $certificate) { } } +if ($missing = implode(', ', array_diff($config['only'], $domains))) { + $climate->to('error')->error("No certificates configured for domains: $missing!"); + exit(EX_CONFIG_INVALID); +} + if ($notifications) { sendNotification('New certificates were issued and/or installed.', implode(PHP_EOL, $notifications)); }