blob: 2aa495dee73f9e3a9908b0c941f99bb32f0e4ebe (
plain)
- #!/bin/sh
- #
- # Renew letsencrypt certificates
- set -eu
- # update non-EC maildomain cert if resolvable and not a certdomain
- maildomain=$(cat /etc/local-REDPILL/$(cat /etc/local-ORG/realm)/mailhost) || true
- mailname=$(cat /etc/mailname) || true
- 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" ] \
- || [ "$maildomain" != "$mailname" ] \
- || grep ^"$maildomain" /etc/dehydrated/domains.txt \
- || dehydrated --cron --domain "$maildomain $extradomains" --algo rsa
- # update certdomain certs
- dehydrated --cron "$@"
|