Created
June 14, 2023 00:09
-
-
Save Jimbolino/a2c8c0aeafa8ed35a364786e1aea77ba to your computer and use it in GitHub Desktop.
HP DeskJet 2600 letsencrypt auto renewal script
This file contains hidden or 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
#!/usr/bin/env bash | |
IP=192.168.1.123 | |
PFX=certificate.pfx | |
DOMAIN=hp2600.example.com | |
PASS=$(cat /proc/sys/kernel/random/uuid) | |
openssl pkcs12 -export -out ${PFX} -inkey /etc/letsencrypt/live/${DOMAIN}/privkey.pem -in /etc/letsencrypt/live/${DOMAIN}/cert.pem -passout pass:"${PASS}" | |
curl --silent --insecure "https://${IP}/Security/DeviceCertificates/NewCertWithPassword/Upload?fixed_response=true" --form certificate=@${PFX} --form password="${PASS}" > last-result.log | |
rm ${PFX} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment