diff --git a/readme.md b/readme.md index a42e5c2..ce580ee 100644 --- a/readme.md +++ b/readme.md @@ -230,7 +230,6 @@ Handle project workflows in a unified way: * available * effective * factorize - * ca * dns * locales * handle errors diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 65e71c6..2d17ee3 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -200,33 +200,27 @@ _spcd_txt_pick() { # ╰───────────╯ spcd_ca() { - local index name value local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)" - case "${1}" in - "list") - while true; do - index=$((index + 1)) - name="SPCD_CA_${index}" - eval "value=\"\${${name}}\"" - [ -n "${value}" ] || break + local index name value + local root="${2}" + while true; do + index=$((index + 1)) + name="SPCD_CA_${index}" + eval "value=\"\${${name}}\"" + [ -n "${value}" ] || break + case "${1}" in + "list") echo "${name} =" echo "${value}" | openssl x509 -noout -text | grep "${grep}" - done - ;; - "write") - local root="${2}" - while true; do - index=$((index + 1)) - name="SPCD_CA_${index}" - eval "value=\"\${${name}}\"" - [ -n "${value}" ] || break + ;; + "write") spcd_os_write "${root}/${index}.crt" "${value}" - done - ;; - *) ;; - esac + ;; + *) ;; + esac + done } spcd_dns() {