Last active
May 29, 2017 08:51
-
-
Save giulianoriccio/352e4b69a4fe042b7cdf4cbc4c6430e5 to your computer and use it in GitHub Desktop.
let's encrypt on plesk using certbot - certificate renewal hook
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 | |
timestamp=$(date +"%Y-%m-%d %H:%M:%S") | |
/usr/local/psa/bin/certificate -c "${RENEWED_DOMAINS%% *} $timestamp" -domain ${RENEWED_DOMAINS%% *} -key-file $RENEWED_LINEAGE/privkey.pem -cert-file $RENEWED_L$ | |
if [[ $? != 0 ]] ; then | |
echo "The certificate creation for ${RENEWED_DOMAINS%% *} has failed on Plesk" | |
exit 1 | |
fi | |
/usr/local/psa/bin/subscription -u ${RENEWED_DOMAINS%% *} -certificate-name "${RENEWED_DOMAINS%% *} $timestamp" | |
if [[ $? != 0 ]] ; then | |
echo "The certificate could not be assigned to ${RENEWED_DOMAINS%% *} on Plesk" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment