2020-11-05 15:35:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
CERT_PATH="/snikket/letsencrypt/live/$SNIKKET_DOMAIN/cert.pem"
|
|
|
|
|
|
|
|
if test -f "$CERT_PATH"; then
|
|
|
|
## Certs already exist - render and deploy configs
|
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
|
2021-02-02 11:45:43 +00:00
|
|
|
else
|
2021-02-02 16:10:36 +00:00
|
|
|
/usr/local/bin/render-template.sh "/etc/nginx/templates/startup" "/etc/nginx/sites-enabled/startup";
|
2020-11-05 15:35:56 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
exec supervisord -c /etc/supervisord/supervisord.conf
|