Created
May 19, 2015 20:00
-
-
Save br0ziliy/4f44a1fa59aabf945cb4 to your computer and use it in GitHub Desktop.
Reset CPanel SSL certificates from command line (CLI) using API
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
# Create root account access hash, if it's not there | |
[ -f /root/.accesshash ] || /usr/local/cpanel/bin/mkaccesshash | |
# List CPanel services that have SSL installed | |
curl -s -k -H "Authorization: WHM root:"`cat /root/.accesshash | sed ':a;N;$!ba;s/\n//g'` 'https://localhost:2087/json-api/fetch_service_ssl_components?api.version=1' | python -mjson.tool | grep service | |
# Reset SSL certificate for a service (courier-imapd in this example | |
curl -s -k -H "Authorization: WHM root:"`cat /root/.accesshash | sed ':a;N;$!ba;s/\n//g'` 'https://localhost:2087/json-api/reset_service_ssl_certificate?api.version=1&service=courier-imapd' | python -mjson.tool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment