File size: 593 Bytes
560ee81 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/bin/bash
# Lets Encrypt
if [ -z "$WEBROOT" ] || [ -z "$GIT_EMAIL" ] || [ -z "$DOMAIN" ]; then
echo "You need the \$WEBROOT, \$GIT_EMAIL and the \$DOMAIN Variables"
else
certbot certonly --webroot -w $WEBROOT -d $DOMAIN --email $GIT_EMAIL --agree-tos --quiet
ln -s /etc/nginx/sites-available/default-ssl.conf /etc/nginx/sites-enabled/
# change nginx for webroot and domain name
sed -i "s/##DOMAIN##/${DOMAIN}/g" /etc/nginx/sites-enabled/default-ssl.conf
sed -i "s#root /var/www/html;#root ${WEBROOT};#g" /etc/nginx/sites-available/default-ssl.conf
supervisorctl restart nginx
fi
|