Last active
January 20, 2022 12:51
-
-
Save tom-krieger/c1b4c90fbc324d693802dead32c18012 to your computer and use it in GitHub Desktop.
Script to upload a crl to PE
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
#!/bin/bash | |
if [ $# -ne 1 ] ; then | |
prog=`basename $0` | |
echo "usage: $prog <crl file>" | |
exit 2 | |
fi | |
type_header='Content-Type: text/plain' | |
cert="$(puppet config print hostcert)" | |
cacert="$(puppet config print localcacert)" | |
key="$(puppet config print hostprivkey)" | |
uri="https://$(puppet config print server):8140/puppet-ca/v1/certificate_revocation_list" | |
curl --insecure --cert "$cert" --cacert "$cacert" --key "$key" \ | |
--header "Content-Type: text/plain" --header "Accept: text/plain" \ | |
--request PUT --data-binary "@$1" "$uri" | |
ret=$? | |
echo | |
exit $ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment