cd_openssl

This commit is contained in:
Marc Beninca 2024-05-04 09:50:13 +02:00
parent 86dd9748b5
commit 30160e1544
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 14 additions and 3 deletions

15
cd.sh
View file

@ -227,13 +227,17 @@ cd_install_ca_certificates () {
cd_write_ca_certificates () { cd_write_ca_certificates () {
local index local index
local path
local text local text
cd_step "Write CA certificates" cd_step "Write CA certificates"
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}" path="${CD_CA_ROOT}/${index}.crt"
cd_split
cd_write "${path}" "${text}"
cd_openssl "${path}"
index=$((index+1)) index=$((index+1))
eval "text=\"\${CD_CA_${index}}\"" eval "text=\"\${CD_CA_${index}}\""
done done
@ -320,7 +324,7 @@ ${1}
# functions # functions
cd_cat () { cd_cat () {
if [ -f "${1}" ] ; then if [ "${1}" ] ; then
echo "╭╴$(realpath "${1}")" echo "╭╴$(realpath "${1}")"
cat "${1}" || exit cat "${1}" || exit
fi fi
@ -379,6 +383,13 @@ cd_mkdir () {
cd_nop () { true ; } cd_nop () { true ; }
cd_openssl () {
local file="${1}"
if [ "${file}" ] ; then
openssl x509 -noout -text -in "${file}" || exit
fi
}
cd_rm () { cd_rm () {
if [ -e "${1}" ] ; then if [ -e "${1}" ] ; then
echo "$(realpath "${1}")" echo "$(realpath "${1}")"

View file

@ -33,7 +33,7 @@ from various CA, CI, OCI / OS.
* handle cloning credentials * handle cloning credentials
* make steps more agnostic * make steps more agnostic
* show CA certificates as text * reduce single conditions with &&
* write Python bootstrap * write Python bootstrap
* first list working directory * first list working directory