From a79ead02d339ef602e3b275dca4a9289be54e829 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 25 May 2023 19:17:53 -0500 Subject: [PATCH] Update sites.inc --- inc/sites.inc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/inc/sites.inc b/inc/sites.inc index a6eb9b70..ac00c101 100755 --- a/inc/sites.inc +++ b/inc/sites.inc @@ -545,20 +545,9 @@ SITEINFO(){ if [ "${certpath}" != "" ]; then ssl='Yes' certpath=${certpath%/*}; certpath=${certpath#* } - SUBJECT=$(openssl x509 -in ${certpath}/cert.pem -noout -subject|grep -oP '(?<=CN = )[^,]+'|sort -uV) SUBJECTNAMES=$(openssl x509 -in ${certpath}/cert.pem -noout -text|grep -oP '(?<=DNS:|IP Address:)[^,]+'|sort -uV) CERTEXPIRE=$(date -d "$(: | openssl x509 -in ${certpath}/cert.pem -text | grep 'Not After' |awk '{print $4,$5,$7}')" '+%s'); - if [ "${SUBJECTNAMES}" != "" ]; then - echo "HERE: ${SUBJECTNAMES}" - SUBJECTNAMES=${SUBJECTNAMES//$'\n'/, } - # SUBJECTNAMES=$(echo $${SUBJECTNAMES} | sed "s/\n/, /g") - SUBJECTNAMES=$(echo ${SUBJECTNAMES} | sed "s/${SUBJECT}, //g") - SUBJECTNAMES=$(echo ${SUBJECTNAMES} | sed "s/, ${SUBJECT}//g") - SUBJECTNAMES=$(echo ${SUBJECTNAMES} | sed "s/${SUBJECT}//g") - SSLNAMES="${SUBJECT}, ${SUBJECTNAMES}" - else - SSLNAMES="${SUBJECT}" - fi + else ssl='-' fi @@ -567,7 +556,7 @@ SITEINFO(){ [ "$(grep include/secure-access.conf ${sitefile})" != "" ] && lock='Yes' || lock='-' echo -e "${idsCL[Cyan]}!) Site: ${idsST[Bold]}${site}${idsST[Reset]}" - echo -e "${idsCL[Cyan]}!) SSL: ${idsST[Bold]}${ssl}${idsST[Reset]} - ${idsCL[LightCyan]}${SSLNAMES}" + echo -e "${idsCL[Cyan]}!) SSL: ${idsST[Bold]}${ssl}${idsST[Reset]} - ${idsCL[LightCyan]}${SUBJECTNAMES}" echo -e "${idsCL[Cyan]}3) HSTS ${idsST[Bold]}${hsts}${idsST[Reset]}" echo -e "${idsCL[Cyan]}4) WbSkt: ${idsST[Bold]}${wbskt}${idsST[Reset]}" echo -e "${idsCL[Cyan]}5) Lock: ${idsST[Bold]}${lock}${idsST[Reset]}"