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

View file

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