This commit is contained in:
Marc Beninca 2024-05-03 17:19:35 +02:00
parent b4abe18a03
commit c068a571e6
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

18
cd.sh
View file

@ -35,9 +35,18 @@ cd_main () {
# steps # steps
cd_set_environment_variables () { cd_set_environment_variables () {
local variable local index
local text
cd_step "Set environment variables" 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 case "$(cd_grep_os ID)" in
"debian") "debian")
CD_OS_ID="${CD_OS_DEBIAN}" CD_OS_ID="${CD_OS_DEBIAN}"
@ -101,6 +110,8 @@ local variable
CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}"
CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}"
# #
cd_echo "CD_CA"
cd_split
cd_echo "CD_OS_ID" "CD_OS_VERSION" cd_echo "CD_OS_ID" "CD_OS_VERSION"
cd_split cd_split
cd_echo "CD_DNS_FILE" cd_echo "CD_DNS_FILE"
@ -170,12 +181,11 @@ local text
cd_step "Copy CA" cd_step "Copy CA"
cd_mkdir "${CD_CA_ROOT}" cd_mkdir "${CD_CA_ROOT}"
index=1 index=1
eval "text=\${CD_CA_${index}}" eval "text=\"\${CD_CA_${index}}\""
while [ "${text}" ] ; do while [ "${text}" ] ; do
cd_write "${CD_CA_ROOT}/${index}.crt" "${text}" cd_write "${CD_CA_ROOT}/${index}.crt" "${text}"
CD_CA=$((CD_CA+1))
index=$((index+1)) index=$((index+1))
eval "text=\${CD_CA_${index}}" eval "text=\"\${CD_CA_${index}}\""
done done
} }