From 292d5e0c9e616ce3f61594004d8a075a1c2d6057 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Apr 2024 12:30:08 +0200 Subject: [PATCH] cd_write_ca --- cd.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 60e36e1..7ea99ee 100644 --- a/cd.sh +++ b/cd.sh @@ -18,7 +18,7 @@ cd_main () { cd_update_packages_catalog cd_install_packages_tools cd_install_ca - cd_copy_ca + cd_write_ca cd_update_ca cd_set_https_verification_on cd_update_packages_catalog @@ -191,15 +191,23 @@ cd_install_ca () { cd_install_package "${CD_CA_PACKAGE}" } -cd_copy_ca () { +cd_write_ca () { +local index local target +local text cd_step "Copy CA" case "${CD_OS_NAME}" in "debian") target="/usr/local/share/ca-certificates" ;; "alma") target="/etc/pki/ca-trust/source/anchors" ;; *) cd_error_os "cd_copy_ca" ;; esac - echo "TODO" + index=1 + eval "text=\${CD_CA_${index}}" + while [ "${text}" ] ; do + cd_write "${target}/${index}.crt" "${text}" + index=$((index+1)) + eval "text=\${CD_CA_${index}}" + done } cd_update_ca () {