From 38d213895037aac4d9fb0a17aef0a2db831eb199 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 09:33:50 +0200 Subject: [PATCH] cd_ca_root --- cd.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cd.sh b/cd.sh index d5a54ae..981908d 100644 --- a/cd.sh +++ b/cd.sh @@ -42,10 +42,12 @@ cd_set_environment () { # case "${CD_OS_NAME}" in "debian") + CD_CA_ROOT="/usr/local/share/ca-certificates" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; "alma") + CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" case "${CD_OS_VERSION}" in "8"|"9") CD_PYTHON_PACKAGE="python3.11" @@ -153,21 +155,13 @@ Dir::Etc::SourceParts \"\"; cd_write_ca_certificates () { local index -local target local text cd_step "Copy CA" - case "${CD_OS_NAME}" in - "debian") - target="/usr/local/share/ca-certificates" - cd_mkdir "${target}" - ;; - "alma") target="/etc/pki/ca-trust/source/anchors" ;; - *) cd_error_os "cd_copy_ca" ;; - esac + cd_mkdir "${CD_CA_ROOT}" index=1 eval "text=\${CD_CA_${index}}" while [ "${text}" ] ; do - cd_write "${target}/${index}.crt" "${text}" + cd_write "${CD_CA_ROOT}/${index}.crt" "${text}" CD_CA=$((CD_CA+1)) index=$((index+1)) eval "text=\${CD_CA_${index}}"