Update sites.inc
This commit is contained in:
@@ -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]}"
|
||||
|
||||
Reference in New Issue
Block a user