You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1015 B

3 years ago
  1. #!/bin/bash
  2. RCODE=$?
  3. #Saisir le FQDN
  4. FQDN_1=zimbrapro.altinea.fr
  5. #FQDN_2=smtp.it-nea.eu
  6. /root/.acme.sh/acme.sh --issue --standalone --keylength 4096 -d ${FQDN_1}
  7. #/root/.acme.sh/acme.sh --issue --standalone --keylength 4096 -d ${FQDN_1} -d ${FQDN_2}
  8. if [ $RCODE -eq 0 ]; then
  9. su - zimbra -c "/opt/zimbra/bin/zmcertmgr verifycrt comm /opt/zimbra/ssl/zimbra/commercial/commercial.key /etc/myacme/${FQDN_1}/${FQDN_1}.cer"
  10. VERIF_RCODE=$(su - zimbra -c"echo $?")
  11. if [ $VERIF_RCODE -eq 1 ]; then
  12. echo "erreur dans la vérification du certificat"
  13. exit 1;
  14. fi
  15. su - zimbra -c "/opt/zimbra/bin/zmcertmgr deploycrt comm /etc/myacme/${FQDN_1}/${FQDN_1}.cer /opt/zimbra/ssl/zimbra/commercial/commercial_ca.crt"
  16. CERT_RCODE=$(su - zimbra -c"echo $?")
  17. if [ $CERT_RCODE -eq 1 ]; then
  18. echo "erreur dans la mise en place du certificat"
  19. exit 1;
  20. fi
  21. su - zimbra -c "zmcontrol restart"
  22. fi
  23. if [ $RCODE -eq 1 ]; then
  24. echo Erreur de renouvellement
  25. exit 1;
  26. fi