1
0
Fork 0
mirror of https://codeberg.org/ashley/poke.git synced 2024-11-17 10:54:39 -05:00
poke/entrypoint.sh

31 lines
588 B
Bash
Raw Normal View History

#!/usr/bin/bash
set -e
if [[ "$STAGING" == true ]]; then
TEST="--test-cert"
echo Using staging server!
else
TEST=""
echo Using production server!
fi
if [[ -v "HOSTNAME" && -v "EMAIL" ]]; then
echo Creating nginx config...
sed -i "s/SERVERNAME/$HOSTNAME/" /etc/nginx/conf.d/poketube.conf
echo Starting certbot
certbot run --nginx -n \
-d $HOSTNAME \
2022-12-30 16:48:17 -05:00
-d www.$HOSTNAME --agree-tos \
--email $EMAIL \
$TEST
echo Starting nginx
nginx -s reload
2022-12-30 16:48:17 -05:00
else
echo Please set HOSTNAME and/or EMAIL!
exit 1
fi
2022-12-30 16:48:17 -05:00
exec "$@"