AkurAI Build
Menu

Public repository / 0d7f5f902b20084326479f36d4ccf2b55ee890c0

AkurAI-Mail / scripts/ops/certbot-reload-mail.sh

Latest change e0753e49bfea7ef672aabf8df9a3a27b8bdd9dc7 - Recover EC2-only ops scripts, checks and live divergent copies by Ólafur Búi Ólafsson

#!/usr/bin/env bash
# scripts/ops/certbot-reload-mail.sh — certbot deploy hook.
# Installed at /etc/letsencrypt/renewal-hooks/deploy/reload-mail.sh so it runs
# after ANY cert renewal (certbot only invokes deploy hooks on certs actually
# renewed, via $RENEWED_LINEAGE). Reloads postfix + dovecot so the renewed
# cert is picked up — a renewed cert nobody reloaded is still an outage.
set -euo pipefail

case "${RENEWED_LINEAGE:-}" in
    */mail.olibuijr.com)
        systemctl reload postfix
        systemctl reload dovecot
        logger -t certbot-reload-mail "reloaded postfix+dovecot for ${RENEWED_LINEAGE}"
        ;;
esac