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.

23 lines
831 B

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