From d453e5eb6701eb5581b5fe3468a3870e9c6098d5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 8 Sep 2024 23:32:36 +0200 Subject: [PATCH] f/ca --- spcd/bootstrap.sh | 52 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index c1e64aa..a12fadb 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -211,30 +211,6 @@ _spcd_txt_pick() { # │ p = public │ # ╰────────────╯ -spcd_ca() { - local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)" - 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}" - ;; - "write") - spcd_os_write "${root}/${index}.crt" "${value}" - ;; - *) ;; - esac - done -} - spcd_run() { if [ -n "${1}" ]; then _spcd_frame_open "${@}" @@ -401,7 +377,7 @@ SPCD_PM_ZYPPER="zypper" # ╰───┴───────────╯ spcd_step__environment_print() { - spcd_ca "list" + spcd_f_ca "list" spcd_f_dns "list" set -- \ "GIT_RWX" \ @@ -840,6 +816,30 @@ spcd_python_pip() { # │ f │ ca = certificate authorities │ # ╰───┴──────────────────────────────╯ +spcd_f_ca() { + local grep="\(After\|Before\|Issuer\|Signature Algorithm\|Subject:\)" + 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}" + ;; + "write") + spcd_os_write "${root}/${index}.crt" "${value}" + ;; + *) ;; + esac + done +} + spcd_f_ca_install() { spcd_step "Install package" spcd_f_pm_pkg_install "ca-certificates" @@ -883,7 +883,7 @@ spcd_f_ca_write() { *) ;; esac spcd_os_mkdir "${root}" - spcd_ca "write" "${root}" + spcd_f_ca "write" "${root}" } # ╭───┬──────────────────────╮