bootstrap-rocky-9/install-a-root-ca-cert.sh
2024-11-28 20:18:43 +02:00

16 lines
316 B
Bash
Executable File

#!/usr/bin/env bash
CERT_FILENAME="$1"
if [ ! -f "${CERT_FILENAME}" ]
then
echo "Missing cert file: ${CERT_FILENAME}"
exit 1
fi
CERT_CHECKSUM=$(sha256sum "${CERT_FILENAME}"|awk '{ print $1}')
echo "${CERT_CHECKSUM}"
cp "${CERT_FILENAME}" "/etc/pki/ca-trust/source/anchors/${CERT_CHECKSUM}.crt"
update-ca-trust