Update nodemgmt-scripts.sh
This commit is contained in:
@@ -584,43 +584,7 @@ LISTCERTS(){
|
|||||||
echo
|
echo
|
||||||
echo -e "${idsCL[LightGreen]}Current Certificates on Node...${idsCL[Default]}"
|
echo -e "${idsCL[LightGreen]}Current Certificates on Node...${idsCL[Default]}"
|
||||||
DIVIDER
|
DIVIDER
|
||||||
echo -e "Subject Name Expires Alternate Subjects"
|
/opt/idssys/nodemgmt/ssl-cert-check/ssl-cert-check -f /opt/idssys/nodemgmt/ssl-cert-check/ssldomains
|
||||||
DIVIDER
|
|
||||||
for certdir in /etc/letsencrypt/live/*/ ; do
|
|
||||||
# SUBJECT=$(openssl x509 -in ${certdir}/cert.pem -noout -subject|grep -oP '(?<=CN = )[^,]+'|sort -uV)
|
|
||||||
# SUBJECTNAMES=$(openssl x509 -in ${certdir}/cert.pem -noout -text|grep -oP '(?<=DNS:|IP Address:)[^,]+'|sort -uV)
|
|
||||||
# SUBJECTNAMES=${SUBJECTNAMES//$'\n'/, }
|
|
||||||
# SUBJECTNAMES=$(echo $SUBJECTNAMES | sed "s/${SUBJECT}, //g")
|
|
||||||
# SUBJECTNAMES=$(echo $SUBJECTNAMES | sed "s/, ${SUBJECT}//g")
|
|
||||||
# SUBJECTNAMES=$(echo $SUBJECTNAMES | sed "s/${SUBJECT}//g")
|
|
||||||
# CERTEXPIRE=$(date -d "$(: | openssl x509 -in ${certdir}/cert.pem -text | grep 'Not After' |awk '{print $4,$5,$7}')" '+%s');
|
|
||||||
# DAYS=14; DUEIN=$(($(date +%s) + (86400*$DAYS)));
|
|
||||||
|
|
||||||
AWK=$(which awk)
|
|
||||||
DATE=$(which date)
|
|
||||||
GREP=$(which grep)
|
|
||||||
OPENSSL=$(which openssl)
|
|
||||||
SED=$(which sed)
|
|
||||||
|
|
||||||
|
|
||||||
CERTDATE=$(${OPENSSL} x509 -in ${certdir}/cert.pem -text -enddate -noout -inform pem | ${SED} 's/notAfter\=//')
|
|
||||||
set -- ${CERTDATE}
|
|
||||||
# SUBJECT=$(${OPENSSL} x509 -in ${certdir}/cert.pem -text -subject -noout -inform pem | \
|
|
||||||
# ${SED} -e 's/.*CN=//' | \
|
|
||||||
# ${SED} -e 's/\/.*//')
|
|
||||||
|
|
||||||
|
|
||||||
declare -i cw; declare -i spc1; declare -i c
|
|
||||||
c=0; cw=30; 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
|
|
||||||
echo -e "${idsCL[Cyan]}${SUBJECT}${spc}${CERTDATE} ${idsCL[Cyan]}${SUBJECTNAMES}${idsCL[Default]}"
|
|
||||||
done
|
|
||||||
echo
|
echo
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
DIVIDER true
|
DIVIDER true
|
||||||
|
|||||||
Reference in New Issue
Block a user