diff options
author | Jonas Smedegaard <dr@jones.dk> | 2017-01-01 23:38:59 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2017-01-01 23:38:59 +0100 |
commit | 7106d61f35b5f6dd1b8200a6e8c1cd8a893b76f6 (patch) | |
tree | 0f3c2626685a4529f6eff6d824ac156e5d619913 | |
parent | 3d73740c027ee86d5a6d10f5a0b1dc0bbc67c434 (diff) |
Include fqdn and domain in maildomain cert.
-rwxr-xr-x | letsencrypt.sh/cron.weekly/local-letsencrypt.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/letsencrypt.sh/cron.weekly/local-letsencrypt.sh b/letsencrypt.sh/cron.weekly/local-letsencrypt.sh index 8a6bef2..0600730 100755 --- a/letsencrypt.sh/cron.weekly/local-letsencrypt.sh +++ b/letsencrypt.sh/cron.weekly/local-letsencrypt.sh @@ -9,6 +9,15 @@ letsencrypt.sh --cron # update non-EC maildomain cert if resolvable and not clashing with certdomain maildomain=$(cat /etc/local-REDPILL/$(cat /etc/local-ORG/realm)/mailhost) +fqdn=$(hostname --fqdn) +[ -z "$fqdn" ] \ + || [ "$maildomain" = "$fqdn" ] \ + || extradomains=${extradomains:+$extradomains }$fqdn +domain=$(hostname --domain) +[ -z "$domain" ] \ + || [ "$maildomain" = "$domain" ] \ + || [ "$fqdn" = "$domain" ] \ + || extradomains=${extradomains:+$extradomains }$domain [ -z "$maildomain" ] \ || grep ^"$maildomain" /etc/letsencrypt.sh/domains.txt \ - || letsencrypt.sh --cron --domain "$maildomain" --algo rsa + || letsencrypt.sh --cron --domain "$maildomain $extradomains" --algo rsa |