nginx-configurator/config/ncc-hook.sh

23 lines
449 B
Bash
Raw Normal View History

2023-11-05 14:47:28 +01:00
#!/usr/bin/env bash
# This hook is part of ncc. It creates a marker file on new cert deployments,
# so that ncc knows when to reload the cluster.
deploy_cert() {
touch /etc/autossl/trigger;
}
deploy_ocsp() {
touch /tmp/ncc-ssl-trigger;
}
startup_hook() {
[ -f /tmp/ncc-ssl-trigger ] && rm /tmp/ncc-ssl-trigger || true;
}
fn_exists() { declare -F "$1" > /dev/null; }
HANDLER="$1"; shift
if fn_exists "$HANDLER"; then
"$HANDLER" "$@";
fi