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

#!/bin/bash
su zimbra /opt/zimbra/bin/zmproxyctl stop
cd /
cd letsencrypt
./letsencrypt-auto certonly --standalone -d zimbrapro.altinea.fr -n
cp /certificat/ca-root.pem /etc/letsencrypt/live/zimbrapro.altinea.fr
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
#echo chain-root-ca.pem
mkdir /opt/zimbra/ssl/letsencrypt
cp /etc/letsencrypt/live/zimbrapro.altinea.fr/* /opt/zimbra/ssl/letsencrypt/
#echo copy OK
rm /opt/zimbra/ssl/letsencrypt/chain.pem
mv /opt/zimbra/ssl/letsencrypt/chain-root-ca.pem /opt/zimbra/ssl/letsencrypt/chain.pem
chown zimbra:zimbra /opt/zimbra/ssl/letsencrypt/*
chown zimbra:zimbra /opt/zimbra/ssl/letsencrypt/
cp -a /opt/zimbra/ssl/zimbra /opt/zimbra/ssl/zimbra.$(date "+%Y%m%d")
cp /opt/zimbra/ssl/letsencrypt/privkey.pem /opt/zimbra/ssl/zimbra/commercial/commercial.key
su - zimbra -c"
cd /opt/zimbra/ssl/letsencrypt/
/opt/zimbra/bin/zmcertmgr deploycrt comm cert.pem chain.pem
#echo ok
#echo redemarrage du zimbra
zmcontrol restart"
#echo fin de la mise à jour du certificat!