#!/bin/bash
source /root/envsetup/conf.sh

# deploy ssl certificate
if ( test ${SSL_CERTIFICATE} )
then
sed -i "s@/etc/ssl/certs/ssl-cert-snakeoil.pem@${SSL_CERTIFICATE}@" /etc/nginx/conf.d/ssl.conf
fi

if ( test ${SSL_CERTIFICATE_KEY} )
then
sed -i "s@/etc/ssl/private/ssl-cert-snakeoil.key@${SSL_CERTIFICATE_KEY}@" /etc/nginx/conf.d/ssl.conf
fi
