Skip to content

Commit

Permalink
Move inline_expire()
Browse files Browse the repository at this point in the history
Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Feb 28, 2022
1 parent db7a2a1 commit 4515abe
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions easytls
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
{
Expand Down Expand Up @@ -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 ()
{
Expand Down

1 comment on commit 4515abe

@TinCanTech
Copy link
Owner Author

@TinCanTech TinCanTech commented on 4515abe Feb 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.