|
@ -1,23 +1,29 @@ |
|
|
#!/bin/bash |
|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
RCODE=$? |
|
|
#Saisir le FQDN |
|
|
#Saisir le FQDN |
|
|
FQDN_1=zimbrapro.altinea.fr |
|
|
FQDN_1=zimbrapro.altinea.fr |
|
|
#FQDN_2=smtp.it-nea.eu |
|
|
#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" |
|
|
echo "erreur dans la vérification du certificat" |
|
|
exit 1; |
|
|
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" |
|
|
echo "erreur dans la mise en place du certificat" |
|
|
exit 1; |
|
|
exit 1; |
|
|
|
|
|
fi |
|
|
|
|
|
su - zimbra -c "zmcontrol restart" |
|
|
fi |
|
|
fi |
|
|
su - zimbra -c "zmcontrol restart" |
|
|
|
|
|
|
|
|
if [ $RCODE -eq 1 ]; then |
|
|
|
|
|
echo Erreur de renouvellement |
|
|
|
|
|
exit 1; |
|
|
|
|
|
fi |
|
|
|
|
|
|