From 4515abe3903c1e6fd191e9e4ffd6502c9789f3dd Mon Sep 17 00:00:00 2001 From: Richard T Bonhomme Date: Mon, 28 Feb 2022 16:07:14 +0000 Subject: [PATCH] Move inline_expire() Signed-off-by: Richard T Bonhomme --- easytls | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/easytls b/easytls index 7a8f331..6c185a2 100755 --- a/easytls +++ b/easytls @@ -2684,6 +2684,30 @@ cert_expire () easytls_verbose } # => cert_expire () +# Get inline certificate expiry Date +inline_expire () +{ + easytls_verbose + name="${1}" + + if [ -n "${name}" ]; then + inline_file="${EASYTLS_PKI}/${name}.inline" + [ -f "${inline_file}" ] || missing_file "${inline_file}" + inline_expire_date + print " Certificate: ${name}.inline Expire-date: ${inline_expire}" + else + # Get a list of Valid names from easytls-inline-index + etls_valid_name_list="$(inline_index_cn_subname_list)" + for name in ${etls_valid_name_list}; do + inline_file="${EASYTLS_PKI}/${name}.inline" + [ -f "${inline_file}" ] || missing_file "${inline_file}" + inline_expire_date + print " Inline-file: ${name}.inline Expire-date: ${inline_expire}" + done + fi + easytls_verbose +} # => inline_expire () + # Extract enddate from .inline certificate inline_expire_date () { @@ -2712,30 +2736,6 @@ inline_index_cn_subname_list () }' "${EASYTLS_INLINE_INDEX}" } # => inline_index_cn_subname_list () -# Get inline certificate expiry Date -inline_expire () -{ - easytls_verbose - name="${1}" - - if [ -n "${name}" ]; then - inline_file="${EASYTLS_PKI}/${name}.inline" - [ -f "${inline_file}" ] || missing_file "${inline_file}" - inline_expire_date - print " Certificate: ${name}.inline Expire-date: ${inline_expire}" - else - # Get a list of Valid names from easytls-inline-index - etls_valid_name_list="$(inline_index_cn_subname_list)" - for name in ${etls_valid_name_list}; do - inline_file="${EASYTLS_PKI}/${name}.inline" - [ -f "${inline_file}" ] || missing_file "${inline_file}" - inline_expire_date - print " Inline-file: ${name}.inline Expire-date: ${inline_expire}" - done - fi - easytls_verbose -} # => inline_expire () - # Keep an inline-index file for inline certs to manage revoke/renew inline_index_update () {