Update certs.inc

This commit is contained in:
2023-11-12 21:51:04 -06:00
parent 49066c553a
commit ee543c7d0e

View File

@@ -208,13 +208,14 @@ LISTCERTS(){
fi
echo
echo -e "${idsCL[LightGreen]}Current Certificates on Node...${idsCL[Default]}"
DIVIDER false yellow 120
[ ${EDIT} -eq 1 ] && lenh="##) " || lenh=""
echo -e "${lenh}Subject Name Monitored Expires Alternate Subject Names"
DIVIDER false yellow 120
cw=34;
c=0; spc2=''; until [ $c = ${cw} ]; do spc2="${spc2} "; c=`expr $c + 1`; done
[ ${EDIT} -eq 1 ] && lenh="##) " || lenh=""
if [ "${SEARCH}" != "0" ]; then
ssldir=$(${NCMD} find ${NM_CERTPATH}/live/*${SEARCH,,}* -type d)
@@ -224,6 +225,14 @@ LISTCERTS(){
i=0
for certdir in ${ssldir[@]}; do
if (( i % 12 == 0 )) || [ $i = 0 ]; then
DIVIDER false yellow 120
echo -e "${lenh}Subject Name Monitored Expires Alternate Subject Names"
DIVIDER false yellow 120
else
DIVIDER false darkGray 120
fi
SUBJECT=$(${NCMD} openssl x509 -in ${certdir}/cert.pem -noout -subject|grep -oP '(?<=CN = )[^,]+'|sort -uV)
SUBJECTNAMES=$(${NCMD} openssl x509 -in ${certdir}/cert.pem -noout -text|grep -oP '(?<=DNS:|IP Address:)[^,]+'|sort -uV)
CERTEXPIRE=$(date -d "$(: | ${NCMD} openssl x509 -in ${certdir}/cert.pem -text | grep 'Not After' |awk '{print $4,$5,$7}')" '+%s');
@@ -261,7 +270,6 @@ LISTCERTS(){
echo -e "${spc2} ${SUBJECT_NAMES[3]}, ${SUBJECT_NAMES[4]}, ${SUBJECT_NAMES[5]}"
fi
DIVIDER false darkGray 120
CERTLIST[${i}]=${SUBJECT}
i=`expr $i + 1`