diff options
author | Jonas Smedegaard <dr@jones.dk> | 2017-01-26 15:41:56 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2017-01-26 15:41:56 +0100 |
commit | 0fb1da0490d840eddccf87668a4c095d8905325c (patch) | |
tree | be532f4d5dcc7b963658675d2fedccbadbb83a92 /dehydrated/cron.weekly/local-dehydrated | |
parent | e042b7bced715a9d0d6c660df453b1b68f263316 (diff) |
Move and adapt letsencrypt.sh → dehydrated.
Diffstat (limited to 'dehydrated/cron.weekly/local-dehydrated')
-rwxr-xr-x | dehydrated/cron.weekly/local-dehydrated | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/dehydrated/cron.weekly/local-dehydrated b/dehydrated/cron.weekly/local-dehydrated new file mode 100755 index 0000000..e07e5d9 --- /dev/null +++ b/dehydrated/cron.weekly/local-dehydrated @@ -0,0 +1,23 @@ +#!/bin/sh +# +# Renew letsencrypt certificates + +set -eu + +# update certdomain certs +dehydrated --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/dehydrated/domains.txt \ + || dehydrated --cron --domain "$maildomain $extradomains" --algo rsa |