add systemd to letsencrypt installer (#8289)

* add systemd to letsencrypt

* Better readability of systemd change

Co-authored-by: Sebastian Feustel <sebastian.feustel@aei.mpg.de>
This commit is contained in:
53845714nF 2021-01-04 15:21:47 +01:00 committed by GitHub
parent 76b4899c39
commit f82088fb8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 6 deletions

View File

@ -96,8 +96,15 @@ if [ -f /etc/nginx/sites-enabled/$DOMAIN.conf ] ; then
sed -i "s/ssl_certificate\ \/etc\/jitsi\/meet\/.*crt/ssl_certificate\ $CERT_CRT_ESC/g" \
$CONF_FILE
echo "service nginx reload" >> $CRON_FILE
if type service >/dev/null 2>&1
then
service nginx reload
echo "service nginx reload" >> $CRON_FILE
else
systemctl reload nginx.service
echo "systemctl reload nginx.service" >> $CRON_FILE
fi
elif [ -f /etc/apache2/sites-enabled/$DOMAIN.conf ] ; then
/usr/bin/certbot certonly --noninteractive \
@ -117,8 +124,14 @@ elif [ -f /etc/apache2/sites-enabled/$DOMAIN.conf ] ; then
sed -i "s/SSLCertificateFile\ \/etc\/jitsi\/meet\/.*crt/SSLCertificateFile\ $CERT_CRT_ESC/g" \
$CONF_FILE
echo "service apache2 reload" >> $CRON_FILE
if type service >/dev/null 2>&1
then
service apache2 reload
echo "service apache2 reload" >> $CRON_FILE
else
systemctl reload apache2.service
echo "systemctl reload apache2.service" >> $CRON_FILE
fi
fi
# the cron file that will renew certificates