Update nodemgmt-scripts.sh
This commit is contained in:
@@ -607,9 +607,9 @@ LISTCERTS(){
|
||||
DIVIDER false yellow 100
|
||||
|
||||
for certdir in $(</tmp/ssllist); do
|
||||
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');
|
||||
# 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');
|
||||
|
||||
SUBJECTNAMES=${SUBJECTNAMES//$'\n'/, }
|
||||
SUBJECTNAMES=$(echo $SUBJECTNAMES | sed "s/${SUBJECT}, //g")
|
||||
@@ -621,11 +621,11 @@ LISTCERTS(){
|
||||
c=0; cw=26; spc=''
|
||||
spc1=${cw}-${#SUBJECT}
|
||||
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
|
||||
# if [ $DUEIN -gt $CERTEXPIRE ]; then
|
||||
# date="${idsST[Bold]}${idsCL[Red]}$(date -d @${CERTEXPIRE} '+%m-%d-%Y')${idsST[Reset]}${idsCL[Default]}"
|
||||
# else
|
||||
# date="${idsCL[Green]}$(date -d @${CERTEXPIRE} '+%m-%d-%Y')${idsCL[Default]}"
|
||||
# fi
|
||||
if [ $DUEIN -gt $CERTEXPIRE ]; then
|
||||
date="${idsST[Bold]}${idsCL[Red]}$(date -d @${CERTEXPIRE} '+%m-%d-%Y')${idsST[Reset]}${idsCL[Default]}"
|
||||
else
|
||||
date="${idsCL[Green]}$(date -d @${CERTEXPIRE} '+%m-%d-%Y')${idsCL[Default]}"
|
||||
fi
|
||||
if [ "${CHECKCERT_DOMAINS[${SUBJECT}]}" = "" ]; then
|
||||
SUBJECT_DISP=${SUBJECT}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user