2020-12-07 16:02:58 +01:00
|
|
|
#!/bin/bash
|
2020-12-06 11:55:59 +01:00
|
|
|
|
2020-12-07 16:02:58 +01:00
|
|
|
echo " >>> Starting nginx <<< "
|
2020-12-06 11:55:59 +01:00
|
|
|
|
|
|
|
mkdir /run/nginx # needed because of bug in package
|
|
|
|
/usr/sbin/nginx -t
|
|
|
|
/usr/sbin/nginx
|
|
|
|
|
2020-12-07 16:02:58 +01:00
|
|
|
echo " >>> Checking / Installing SSL certificate <<< "
|
|
|
|
|
|
|
|
if [[ ${DOMAIN} ]]
|
|
|
|
then
|
|
|
|
echo "Obtaining cert for '${DOMAIN}' ..."
|
|
|
|
echo "Registering with email '${LE_EMAIL}' ..."
|
|
|
|
|
|
|
|
certbot -n \
|
|
|
|
--nginx \
|
|
|
|
--keep-until-expiring \
|
|
|
|
--redirect \
|
|
|
|
--agree-tos \
|
|
|
|
--cert-name ${DOMAIN} \
|
|
|
|
-d ${DOMAIN} \
|
|
|
|
-m ${LE_EMAIL}
|
|
|
|
|
|
|
|
echo "Checked/Installed SSL certificate."
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo " >>> Starting uwsgi <<< "
|
2020-12-06 11:55:59 +01:00
|
|
|
|
2020-12-07 17:46:50 +01:00
|
|
|
exec /usr/sbin/uwsgi --ini /root/ftracker/res/ftracker.alpine.uwsgi.ini
|