renew_certificat_from_letsencrypt
                Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| renew_certificat_from_letsencrypt [2022/10/25 02:02] – inc002 | renew_certificat_from_letsencrypt [2022/10/25 02:11] (Version actuelle) – inc002 | ||
|---|---|---|---|
| Ligne 31: | Ligne 31: | ||
| You need to install certbot with OVH API support described to point 1 and 2 of https:// | You need to install certbot with OVH API support described to point 1 and 2 of https:// | ||
| - | For automatic renewal, you can add to crontab the script bellow | + | For automatic renewal, you can add to crontab the script bellow. Don't forget to change the $DOMAIN variable and adjust the certbot line if your mail server  | 
| - | < | + | <code bash | renewLECertZimbra.sh> | 
| #!/bin/bash | #!/bin/bash | ||
| DOMAIN=' | DOMAIN=' | ||
| + | HOST=' | ||
| + | MAIL_USER=' | ||
| CERTBOT_OUT="" | CERTBOT_OUT="" | ||
| TMP_CERTBOT="/ | TMP_CERTBOT="/ | ||
| Ligne 41: | Ligne 43: | ||
| touch $TMP_CERTBOT | touch $TMP_CERTBOT | ||
| - | / | + | / | 
| - | # | + | # | 
| CERTBOT_OUT=`cat $TMP_CERTBOT | grep " | CERTBOT_OUT=`cat $TMP_CERTBOT | grep " | ||
| if [ -z " | if [ -z " | ||
| then | then | ||
| + | #copy the new cert to zimbra | ||
|   cp / |   cp / | ||
| + | #ajust ownership | ||
|   chown zimbra: |   chown zimbra: | ||
| + | #download LE chain certificate | ||
|   wget -O / |   wget -O / | ||
|   cat / |   cat / | ||
| + | #Temp copy of cert and chain for zimbra integration (removed from /tmp after integration) | ||
|   cp / |   cp / | ||
|   cp / |   cp / | ||
| + | # verify and deploy the cert on zimbra | ||
|   su - zimbra -c "/ |   su - zimbra -c "/ | ||
|   su - zimbra -c "/ |   su - zimbra -c "/ | ||
| + | #remove cert copy to tmp | ||
|   rm / |   rm / | ||
|   rm / |   rm / | ||
| + | #restart zimbra | ||
|   su - zimbra -c " |   su - zimbra -c " | ||
| else | else | ||
| Ligne 65: | Ligne 73: | ||
| rm $TMP_CERTBOT | rm $TMP_CERTBOT | ||
| - | </bash> | + | </code> | 
renew_certificat_from_letsencrypt.1666656140.txt.gz · Dernière modification : 2022/10/25 02:02 de inc002