This commit is contained in:
Marc Beninca 2024-08-31 09:54:01 +02:00
parent c21b751b72
commit 225a48ee21
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -1112,30 +1112,31 @@ spcd_step__ca_install_package() {
spcd_step__ca_write_certificates() { spcd_step__ca_write_certificates() {
spcd_step "Write certificates" spcd_step "Write certificates"
local root index text path
case "${SPCD_OS_ID}" in case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_FEDORA}" | "${SPCD_OS_ROCKY}") "${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_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_OS_ARCH}")
spcd_wcc__root="/etc/ca-certificates/trust-source/anchors" root="/etc/ca-certificates/trust-source/anchors"
;; ;;
"${SPCD_OS_OPENSUSE}") "${SPCD_OS_OPENSUSE}")
spcd_wcc__root="/etc/pki/trust/anchors" root="/etc/pki/trust/anchors"
;; ;;
*) ;; *) ;;
esac esac
spcd_os_mkdir "${spcd_wcc__root}" spcd_os_mkdir "${root}"
while true; do while true; do
spcd_wcc__index=$((spcd_wcc__index + 1)) index=$((index + 1))
eval "spcd_wcc__text=\"\${SPCD_CA_${spcd_wcc__index}}\"" eval "text=\"\${SPCD_CA_${index}}\""
[ -n "${spcd_wcc__text}" ] || break [ -n "${text}" ] || break
spcd_wcc__path="${spcd_wcc__root}/${spcd_wcc__index}.crt" path="${root}/${index}.crt"
spcd_split spcd_split
spcd_os_write "${spcd_wcc__path}" "${spcd_wcc__text}" spcd_os_write "${path}" "${text}"
spcd_openssl_x509 "${spcd_wcc__path}" spcd_openssl_x509 "${path}"
done done
} }