#!/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