From 338f437861228554bc61005f83cfd1879297fb2e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Apr 2024 13:46:23 +0200 Subject: [PATCH] mv --- cd.sh | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/cd.sh b/cd.sh index cc02193..fddb122 100644 --- a/cd.sh +++ b/cd.sh @@ -14,11 +14,11 @@ cd_main () { cd_set_dns_resolving ${CD_DNS} cd_set_packages_repositories cd_set_packages_configuration + cd_write_ca_certificates cd_set_https_verification_off cd_update_packages_catalog cd_install_packages_tools cd_install_ca_certificates - cd_write_ca_certificates cd_update_ca_certificates cd_set_https_verification_on cd_update_packages_catalog @@ -151,6 +151,28 @@ Dir::Etc::SourceParts \"\"; esac } +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 + 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_set_https_verification_off () { cd_step "Set HTTPS verification off" case "${CD_OS_NAME}" in @@ -191,28 +213,6 @@ cd_install_ca_certificates () { cd_install_package "${CD_CA_PACKAGE}" } -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 - 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_certificates () { cd_step "Update CA" case "${CD_OS_NAME}" in