Skip to content

Instantly share code, notes, and snippets.

@tom-krieger
Last active January 20, 2022 12:51
Show Gist options
  • Save tom-krieger/c1b4c90fbc324d693802dead32c18012 to your computer and use it in GitHub Desktop.
Save tom-krieger/c1b4c90fbc324d693802dead32c18012 to your computer and use it in GitHub Desktop.
Script to upload a crl to PE
#!/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