From 9ad6f3163ccfe1f13fe6b8953e6b04378d8a2ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?s=C3=A9bastien?= Date: Fri, 19 Jan 2024 15:57:45 +0100 Subject: [PATCH] =?UTF-8?q?=09renomm=C3=A9=C2=A0:=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20Lina/lina-cert=5Frenew.sh=20->=20Lina=5FTina/lina-cert=5Fren?= =?UTF-8?q?ew.sh=20=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20zimbra?= =?UTF-8?q?/certificat/renew=5Fcert=5Facmesh=5Fzimbra.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {Lina => Lina_Tina}/lina-cert_renew.sh | 0 zimbra/certificat/renew_cert_acmesh_zimbra.sh | 30 +++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) rename {Lina => Lina_Tina}/lina-cert_renew.sh (100%) diff --git a/Lina/lina-cert_renew.sh b/Lina_Tina/lina-cert_renew.sh similarity index 100% rename from Lina/lina-cert_renew.sh rename to Lina_Tina/lina-cert_renew.sh diff --git a/zimbra/certificat/renew_cert_acmesh_zimbra.sh b/zimbra/certificat/renew_cert_acmesh_zimbra.sh index 26ab83b..6dbf6ab 100644 --- a/zimbra/certificat/renew_cert_acmesh_zimbra.sh +++ b/zimbra/certificat/renew_cert_acmesh_zimbra.sh @@ -1,23 +1,29 @@ #!/bin/bash - +RCODE=$? #Saisir le FQDN FQDN_1=zimbrapro.altinea.fr #FQDN_2=smtp.it-nea.eu -/root/.acme.sh/acme.sh --issue --standalone -d ${FQDN_1} -#/root/.acme.sh/acme.sh --issue --standalone -d ${FQDN_1} -d ${FQDN_2} - -su - zimbra -c "/opt/zimbra/bin/zmcertmgr verifycrt comm /opt/zimbra/ssl/zimbra/commercial/commercial.key /etc/myacme/${FQDN_1}/${FQDN_1}.cer" -VERIF_RCODE=$(su - zimbra -c"echo $?") -if [ $VERIF_RCODE -eq 1 ]; then +/root/.acme.sh/acme.sh --issue --standalone --keylength 4096 -d ${FQDN_1} +#/root/.acme.sh/acme.sh --issue --standalone --keylength 4096 -d ${FQDN_1} -d ${FQDN_2} +if [ $RCODE -eq 0 ]; then + su - zimbra -c "/opt/zimbra/bin/zmcertmgr verifycrt comm /opt/zimbra/ssl/zimbra/commercial/commercial.key /etc/myacme/${FQDN_1}/${FQDN_1}.cer" + VERIF_RCODE=$(su - zimbra -c"echo $?") + if [ $VERIF_RCODE -eq 1 ]; then echo "erreur dans la vérification du certificat" exit 1; -fi + fi -su - zimbra -c "/opt/zimbra/bin/zmcertmgr deploycrt comm /etc/myacme/${FQDN_1}/${FQDN_1}.cer /opt/zimbra/ssl/zimbra/commercial/commercial_ca.crt" -CERT_RCODE=$(su - zimbra -c"echo $?") -if [ $CERT_RCODE -eq 1 ]; then + su - zimbra -c "/opt/zimbra/bin/zmcertmgr deploycrt comm /etc/myacme/${FQDN_1}/${FQDN_1}.cer /opt/zimbra/ssl/zimbra/commercial/commercial_ca.crt" + CERT_RCODE=$(su - zimbra -c"echo $?") + if [ $CERT_RCODE -eq 1 ]; then echo "erreur dans la mise en place du certificat" exit 1; + fi + su - zimbra -c "zmcontrol restart" fi -su - zimbra -c "zmcontrol restart" +if [ $RCODE -eq 1 ]; then + echo Erreur de renouvellement + exit 1; +fi +