From 225a48ee218bc42dee5275b0b0c05fdd1417ef64 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 31 Aug 2024 09:54:01 +0200 Subject: [PATCH] ca --- spcd/bootstrap.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 7f37345..39b2f1b 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -1112,30 +1112,31 @@ spcd_step__ca_install_package() { spcd_step__ca_write_certificates() { spcd_step "Write certificates" + local root index text path case "${SPCD_OS_ID}" in "${SPCD_OS_ALMA}" | "${SPCD_OS_FEDORA}" | "${SPCD_OS_ROCKY}") - spcd_wcc__root="/etc/pki/ca-trust/source/anchors" + root="/etc/pki/ca-trust/source/anchors" ;; "${SPCD_OS_ALPINE}" | "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}") - spcd_wcc__root="/usr/local/share/ca-certificates" + root="/usr/local/share/ca-certificates" ;; "${SPCD_OS_ARCH}") - spcd_wcc__root="/etc/ca-certificates/trust-source/anchors" + root="/etc/ca-certificates/trust-source/anchors" ;; "${SPCD_OS_OPENSUSE}") - spcd_wcc__root="/etc/pki/trust/anchors" + root="/etc/pki/trust/anchors" ;; *) ;; esac - spcd_os_mkdir "${spcd_wcc__root}" + spcd_os_mkdir "${root}" while true; do - spcd_wcc__index=$((spcd_wcc__index + 1)) - eval "spcd_wcc__text=\"\${SPCD_CA_${spcd_wcc__index}}\"" - [ -n "${spcd_wcc__text}" ] || break - spcd_wcc__path="${spcd_wcc__root}/${spcd_wcc__index}.crt" + index=$((index + 1)) + eval "text=\"\${SPCD_CA_${index}}\"" + [ -n "${text}" ] || break + path="${root}/${index}.crt" spcd_split - spcd_os_write "${spcd_wcc__path}" "${spcd_wcc__text}" - spcd_openssl_x509 "${spcd_wcc__path}" + spcd_os_write "${path}" "${text}" + spcd_openssl_x509 "${path}" done }