Skip to content

Instantly share code, notes, and snippets.

@frederickding
Created June 19, 2024 19:02
Show Gist options
  • Save frederickding/fe9ddf5dece07cc12daf537ed84707e6 to your computer and use it in GitHub Desktop.
Save frederickding/fe9ddf5dece07cc12daf537ed84707e6 to your computer and use it in GitHub Desktop.
certbot cockpit deploy script
#!/usr/bin/env bash
DOMAIN=`basename "$RENEWED_LINEAGE"`
case $DOMAIN in
host.example.com)
echo "Host certs renewed"
cp $RENEWED_LINEAGE/fullchain.pem /etc/cockpit/ws-certs.d/$DOMAIN.crt
cp $RENEWED_LINEAGE/privkey.pem /etc/cockpit/ws-certs.d/$DOMAIN.key
chown cockpit-ws:cockpit-ws /etc/cockpit/ws-certs.d/$DOMAIN.crt /etc/cockpit/ws-certs.d/$DOMAIN.key
echo "Restarting Cockpit"
systemctl restart cockpit
;;
esac

This goes in /etc/letsencrypt/renewal-hooks/deploy/ and makes certbot-renewed certificates available for Cockpit (RHEL, Fedora, Oracle, AlmaLinux, Rocky).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment