Created
March 11, 2019 06:33
-
-
Save alanljj/2f90ca543dc2f2e45319ac13c30bbf72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Note: create by itgeeker | |
domain=mail.itgeeker.net | |
su - zimbra -c 'zmproxyctl stop' | |
su - zimbra -c 'zmmailboxdctl stop' | |
mkdir /opt/zimbra/ssl/aliyunssl/ | |
echo "up load aliyun ssl other to this folder first !!!!!!!" | |
cd /opt/zimbra/ssl/aliyunssl/ | |
openssl pkcs8 -topk8 -inform PEM -in 18131XXXXXXXXX.key -outform PEM -nocrypt -out privkey.pem | |
mv 1813131_mail.geekerconsulting.com.pem cert.pem | |
chown zimbra:zimbra /opt/zimbra/ssl/aliyunssl/* | |
su - zimbra -c 'cd /opt/zimbra/ssl/aliyunssl/ && /opt/zimbra/bin/zmcertmgr verifycrt comm privkey.pem cert.pem ' | |
echo "Backup Zimbra SSL directory" | |
cp -a /opt/zimbra/ssl/zimbra /opt/zimbra/ssl/zimbra.$(date "+%Y%m%d") | |
echo "Copy the private key under Zimbra SSL path" | |
cp /opt/zimbra/ssl/aliyunssl/privkey.pem /opt/zimbra/ssl/zimbra/commercial/commercial.key | |
echo "Final SSL deployment" | |
su - zimbra -c 'cd /opt/zimbra/ssl/aliyunssl/ /opt/zimbra/bin/zmcertmgr deploycrt comm cert.pem' | |
echo "restart zimbra" | |
su - zimbra -c 'zmcontrol restart' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment