15 lines
511 B
Bash
15 lines
511 B
Bash
#!/bin/bash
|
||
|
||
if [[ $NINEAPACHE_LETSENCRYPT == 1 ]]
|
||
then
|
||
# On génère ou renouvel le certificat
|
||
echo "CERTIFICAT LETSENCRYPT"
|
||
certbot certonly --webroot -w /usr/local/apache2/htdocs -d ${WEB_URL} --non-interactive --agree-tos --email ${ADMIN_EMAIL}
|
||
|
||
# On supprime la conf ssl pour placer celle de letsencrypt en y placant la web_url
|
||
rm -f /etc/apache2/conf.d/ssl.conf
|
||
envsubst < "/nine/ssl.conf" > "/etc/apache2/conf.d/ssl.conf"
|
||
|
||
# On redemarre apache
|
||
httpd -k graceful
|
||
fi |