graphene-os-server-infrastr.../session-ticket-keys-sync-deploy
2025-10-30 14:22:55 -04:00

30 lines
518 B
Bash
Executable file

#!/bin/bash
set -o errexit -o nounset -o pipefail
cd /etc/session-ticket-keys
exec {fd}>sync-lock
flock $fd
if ! cmp --silent keys sync/keys; then
rsync -aIv sync/{{next,1,2,3,4}.key,keys} .
rm -rf sync
status=0
if systemctl is-active --quiet nginx.service; then
nginx -s reload || status=1
fi
if systemctl is-active --quiet dnsdist.service; then
dnsdist -c -e 'reloadAllCertificates()' || status=1
fi
touch synced
exit $status
fi
rm -rf sync
touch synced