maj du script lets encrypt

This commit is contained in:
Antoine Ouvrard
2020-04-10 10:46:14 +02:00
parent 3ffe65188c
commit 9a186d1ed8
+12 -3
View File
@@ -30,6 +30,9 @@ if [ ! -f certbot-auto ] ; then
fi
CRON_FILE="/etc/cron.weekly/letsencrypt-renew"
if [ ! -d "/etc/cron.weekly" ] ; then
mkdir "/etc/cron.weekly"
fi
echo "#!/bin/bash" > $CRON_FILE
echo "/usr/local/sbin/certbot-auto renew >> /var/log/le-renew.log" >> $CRON_FILE
@@ -58,6 +61,15 @@ if [ -f /etc/nginx/sites-enabled/$DOMAIN.conf ] ; then
echo "service nginx reload" >> $CRON_FILE
service nginx reload
TURN_CONFIG="/etc/turnserver.conf"
if [ -f $TURN_CONFIG ] && grep -q "jitsi-meet coturn config" "$TURN_CONFIG" ; then
echo "Configuring turnserver"
sed -i "s/cert=\/etc\/jitsi\/meet\/.*crt/cert=$CERT_CRT_ESC/g" $TURN_CONFIG
sed -i "s/pkey=\/etc\/jitsi\/meet\/.*key/pkey=$CERT_KEY_ESC/g" $TURN_CONFIG
echo "service coturn restart" >> $CRON_FILE
service coturn restart
fi
elif [ -f /etc/apache2/sites-enabled/$DOMAIN.conf ] ; then
./certbot-auto certonly --noninteractive \
@@ -101,6 +113,3 @@ else
service jitsi-videobridge start
fi
# the cron file that will renew certificates
chmod a+x $CRON_FILE