summaryrefslogtreecommitdiff
path: root/dehydrated/cron.weekly/local-dehydrated
blob: 8408c13899f69d9394eab496f6175ab6a9805c5b (plain)
  1. #!/bin/sh
  2. #
  3. # Renew letsencrypt certificates
  4. set -eu
  5. # update non-EC maildomain cert if resolvable and not a certdomain
  6. maildomain=$(cat /etc/local-REDPILL/$(cat /etc/local-ORG/realm)/mailhost)
  7. domain=$(hostname --domain)
  8. [ -z "$domain" ] \
  9. || [ "$maildomain" = "$domain" ] \
  10. || extradomains=${extradomains:+$extradomains }$domain
  11. [ -z "$maildomain" ] \
  12. || grep ^"$maildomain" /etc/dehydrated/domains.txt \
  13. || dehydrated --cron --domain "$maildomain $extradomains" --algo rsa
  14. # update certdomain certs
  15. dehydrated --cron