snikket-web-proxy/cert-monitor.sh

15 lines
429 B
Bash
Raw Normal View History

2020-11-05 15:35:56 +00:00
#!/bin/bash
CERT_PATH="/snikket/letsencrypt/live/$SNIKKET_DOMAIN/cert.pem"
while sleep 10; do
if test -f "$CERT_PATH"; then
2021-01-29 16:20:55 +00:00
/usr/local/bin/render-template.sh "/etc/nginx/templates/snikket-common" "/etc/nginx/snippets/snikket-common.conf"
2020-11-05 15:35:56 +00:00
for proto in http https; do
2021-01-29 16:20:55 +00:00
/usr/local/bin/render-template.sh "/etc/nginx/templates/$proto" "/etc/nginx/sites-enabled/$proto";
2020-11-05 15:35:56 +00:00
done
/usr/sbin/nginx -s reload
exit 0;
fi
done