From d69d99bf2d9dc0546d32761eebe7c6c0cea8c5b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Faton?= Date: Fri, 28 May 2021 16:58:47 +0200 Subject: [PATCH] =?UTF-8?q?Script=20mise=20=C3=A0=20jour=20certificat=20zi?= =?UTF-8?q?mbra=20V1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zimbra/script-certificat.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/zimbra/script-certificat.sh b/zimbra/script-certificat.sh index baecf5f..0b2edb3 100644 --- a/zimbra/script-certificat.sh +++ b/zimbra/script-certificat.sh @@ -1,2 +1,24 @@ -blah blah blah -d +#!/bin/bash +su zimbra /opt/zimbra/bin/zmproxyctl stop +cd / +cd letsencrypt +./letsencrypt-auto certonly --standalone -d zimbrapro.altinea.fr -n +cp /certificat/ca-root.pem /etc/letsencrypt/live/zimbrapro.altinea.fr +cat /etc/letsencrypt/live/zimbrapro.altinea.fr/chain.pem /etc/letsencrypt/live/zimbrapro.altinea.fr/ca-root.pem > /etc/letsencrypt/live/zimbrapro.altinea.fr/chain-root-ca.pem +#echo chain-root-ca.pem +mkdir /opt/zimbra/ssl/letsencrypt +cp /etc/letsencrypt/live/zimbrapro.altinea.fr/* /opt/zimbra/ssl/letsencrypt/ +#echo copy OK +rm /opt/zimbra/ssl/letsencrypt/chain.pem +mv /opt/zimbra/ssl/letsencrypt/chain-root-ca.pem /opt/zimbra/ssl/letsencrypt/chain.pem +chown zimbra:zimbra /opt/zimbra/ssl/letsencrypt/* +chown zimbra:zimbra /opt/zimbra/ssl/letsencrypt/ +cp -a /opt/zimbra/ssl/zimbra /opt/zimbra/ssl/zimbra.$(date "+%Y%m%d") +cp /opt/zimbra/ssl/letsencrypt/privkey.pem /opt/zimbra/ssl/zimbra/commercial/commercial.key +su - zimbra -c" +cd /opt/zimbra/ssl/letsencrypt/ +/opt/zimbra/bin/zmcertmgr deploycrt comm cert.pem chain.pem +#echo ok +#echo redemarrage du zimbra +zmcontrol restart" +#echo fin de la mise à jour du certificat!