#!/usr/bin/env bash exit_hook() { # This hook is called at the end of the cron command and can be used to # do some final (cleanup or other) tasks. # Reload apache certs $(which apache2ctl) configtest &> /dev/null && $(which systemctl) reload apache2 || echo "Failed to reload apache." # Reload Synapse certs cp /etc/dehydrated/certs/chat.example.com/fullchain.pem /etc/matrix-synapse/fullchain.pem cp /etc/dehydrated/certs/chat.example.com/privkey.pem /etc/matrix-synapse/privkey.pem $(which systemctl) restart matrix-synapse } HANDLER="$1"; shift if [[ "${HANDLER}" =~ ^exit_hook$ ]]; then "$HANDLER" "$@" fi