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.

24 lines
1.1 KiB

  1. #!/bin/bash
  2. su zimbra /opt/zimbra/bin/zmproxyctl stop
  3. cd /
  4. cd letsencrypt
  5. ./letsencrypt-auto certonly --standalone -d zimbrapro.altinea.fr -n
  6. cp /certificat/ca-root.pem /etc/letsencrypt/live/zimbrapro.altinea.fr
  7. 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
  8. #echo chain-root-ca.pem
  9. mkdir /opt/zimbra/ssl/letsencrypt
  10. cp /etc/letsencrypt/live/zimbrapro.altinea.fr/* /opt/zimbra/ssl/letsencrypt/
  11. #echo copy OK
  12. rm /opt/zimbra/ssl/letsencrypt/chain.pem
  13. mv /opt/zimbra/ssl/letsencrypt/chain-root-ca.pem /opt/zimbra/ssl/letsencrypt/chain.pem
  14. chown zimbra:zimbra /opt/zimbra/ssl/letsencrypt/*
  15. chown zimbra:zimbra /opt/zimbra/ssl/letsencrypt/
  16. cp -a /opt/zimbra/ssl/zimbra /opt/zimbra/ssl/zimbra.$(date "+%Y%m%d")
  17. cp /opt/zimbra/ssl/letsencrypt/privkey.pem /opt/zimbra/ssl/zimbra/commercial/commercial.key
  18. su - zimbra -c"
  19. cd /opt/zimbra/ssl/letsencrypt/
  20. /opt/zimbra/bin/zmcertmgr deploycrt comm cert.pem chain.pem
  21. #echo ok
  22. #echo redemarrage du zimbra
  23. zmcontrol restart"
  24. #echo fin de la mise à jour du certificat!