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 () {