mirror of
https://github.com/GrapheneOS/infrastructure.git
synced 2025-11-18 06:01:28 -05:00
30 lines
518 B
Bash
Executable file
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
|