diff --git a/cd.sh b/cd.sh index 11b2f2c..132019a 100644 --- a/cd.sh +++ b/cd.sh @@ -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}")" diff --git a/readme.md b/readme.md index bfe27bf..05e6130 100644 --- a/readme.md +++ b/readme.md @@ -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