This commit is contained in:
Marc Beninca 2024-09-09 00:43:44 +02:00
parent 62ca47aab3
commit 5786944cf9
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -770,9 +770,32 @@ nameserver ${value}
# ╰───┴──────────────────────────────╯ # ╰───┴──────────────────────────────╯
spcd_f_ca() { spcd_f_ca() {
local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)"
local index name value local index name value
local root="${2}" case "${1}" in
"list")
local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)"
;;
"write")
local root
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_FEDORA}" | "${SPCD_OS_ROCKY}")
root="/etc/pki/ca-trust/source/anchors"
;;
"${SPCD_OS_ALPINE}" | "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
root="/usr/local/share/ca-certificates"
;;
"${SPCD_OS_ARCH}")
root="/etc/ca-certificates/trust-source/anchors"
;;
"${SPCD_OS_OPENSUSE}")
root="/etc/pki/trust/anchors"
;;
*) ;;
esac
spcd_os_mkdir "${root}"
;;
*) ;;
esac
while true; do while true; do
index=$((index + 1)) index=$((index + 1))
name="SPCD_CA_${index}" name="SPCD_CA_${index}"
@ -817,28 +840,6 @@ spcd_f_ca_update() {
esac esac
} }
spcd_f_ca_write() {
spcd_step "Write certificates"
local root
case "${SPCD_OS_ID}" in
"${SPCD_OS_ALMA}" | "${SPCD_OS_FEDORA}" | "${SPCD_OS_ROCKY}")
root="/etc/pki/ca-trust/source/anchors"
;;
"${SPCD_OS_ALPINE}" | "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
root="/usr/local/share/ca-certificates"
;;
"${SPCD_OS_ARCH}")
root="/etc/ca-certificates/trust-source/anchors"
;;
"${SPCD_OS_OPENSUSE}")
root="/etc/pki/trust/anchors"
;;
*) ;;
esac
spcd_os_mkdir "${root}"
spcd_f_ca "write" "${root}"
}
# ╭───┬───────────────────╮ # ╭───┬───────────────────╮
# │ f │ env = environment │ # │ f │ env = environment │
# ╰───┴───────────────────╯ # ╰───┴───────────────────╯
@ -1600,7 +1601,7 @@ spcd_main() {
# ca # ca
spcd_step_in "CA" spcd_step_in "CA"
spcd_f_ca_install spcd_f_ca_install
spcd_f_ca_write spcd_f_ca "write"
spcd_f_ca_update spcd_f_ca_update
spcd_step_out spcd_step_out
# packages # packages