Skip to content

Instantly share code, notes, and snippets.

@c64emulator
Forked from sebva/renew_ilo.sh
Created October 18, 2016 21:38
Show Gist options
  • Save c64emulator/4746c960cd0e688203271bcee0d54a5f to your computer and use it in GitHub Desktop.
Save c64emulator/4746c960cd0e688203271bcee0d54a5f to your computer and use it in GitHub Desktop.
Renew/assign a Let's Encrypt certificate on an HP iLO 4 system
#!/bin/zsh
# Needs https://github.com/lukas2511/letsencrypt.sh in dns-01 mode
/opt/letsencrypt/ilo/letsencrypt.sh -c -s /opt/letsencrypt/ilo/ilo.csr -k /opt/letsencrypt/ilo/hook.sh -t dns-01 > /opt/letsencrypt/ilo/ilo.crt
cert=$(cat /opt/letsencrypt/ilo/ilo.crt)
curl --cacert /opt/letsencrypt/intermediate.pem -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Basic [FILL_IN_HERE]" -X POST -d "{\"Action\": \"ImportCertificate\", \"Certificate\": \"$cert\"}" https://ilo.home.vaucher.org/rest/v1/Managers/1/SecurityService/HttpsCert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment