From 84ccc6f21574cbc8216e737fd3a6166035404732 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:28:37 +0200 Subject: [PATCH] ca --- cd.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index 93ca732..ec8ef3c 100644 --- a/cd.sh +++ b/cd.sh @@ -65,6 +65,7 @@ cd_set_environment_variables () { *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" + CD_CMD_CA="update-ca-trust" CD_CMD_CLEAN="dnf clean all" CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_FILE_HTTPS="/etc/dnf/dnf.conf.d/https.conf" @@ -80,6 +81,7 @@ cd_set_environment_variables () { *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/usr/local/share/ca-certificates" + CD_CMD_CA="update-ca-certificates" CD_CMD_CLEAN="apt-get clean" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" CD_FILE_HTTPS="/etc/apt/apt.conf.d/https" @@ -217,6 +219,8 @@ cd_install_packages_tools () { esac } +# agnostic steps + cd_install_ca_certificates () { cd_step "Install CA" cd_install_package "${CD_CA_PACKAGE}" @@ -225,7 +229,7 @@ cd_install_ca_certificates () { cd_write_ca_certificates () { local index local text - cd_step "Copy CA" + cd_step "Write CA certificates" cd_mkdir "${CD_CA_ROOT}" index=1 eval "text=\"\${CD_CA_${index}}\"" @@ -237,15 +241,10 @@ local text } cd_update_ca_certificates () { - cd_step "Update CA" - case "${CD_OS_ID}" in - "${CD_OS_ALMA}") update-ca-trust || exit ;; - "${CD_OS_DEBIAN}") update-ca-certificates || exit ;; - esac + cd_step "Update CA certificates" + ${CD_CMD_CA} || exit } -# agnostic steps - cd_set_https_verification_on () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification on"