From c068a571e6234c87ab042cc7a4e1bf00fd97d568 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 17:19:35 +0200 Subject: [PATCH] cd_ca --- cd.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index d061dd2..c35730d 100644 --- a/cd.sh +++ b/cd.sh @@ -35,9 +35,18 @@ cd_main () { # steps cd_set_environment_variables () { -local variable +local index +local text cd_step "Set environment variables" # + index=1 + eval "text=\"\${CD_CA_${index}}\"" + while [ "${text}" ] ; do + CD_CA=${index} + index=$((index+1)) + eval "text=\"\${CD_CA_${index}}\"" + done + # case "$(cd_grep_os ID)" in "debian") CD_OS_ID="${CD_OS_DEBIAN}" @@ -101,6 +110,8 @@ local variable CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # + cd_echo "CD_CA" + cd_split cd_echo "CD_OS_ID" "CD_OS_VERSION" cd_split cd_echo "CD_DNS_FILE" @@ -170,12 +181,11 @@ local text cd_step "Copy CA" cd_mkdir "${CD_CA_ROOT}" index=1 - eval "text=\${CD_CA_${index}}" + eval "text=\"\${CD_CA_${index}}\"" while [ "${text}" ] ; do cd_write "${CD_CA_ROOT}/${index}.crt" "${text}" - CD_CA=$((CD_CA+1)) index=$((index+1)) - eval "text=\${CD_CA_${index}}" + eval "text=\"\${CD_CA_${index}}\"" done }