This commit is contained in:
Marc Beninca 2024-09-08 23:32:36 +02:00
parent dc47ace951
commit d453e5eb67
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -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}"
}
# ╭───┬──────────────────────╮