Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-06 12:20:33 -06:00
parent c7b2404428
commit 6837f6ceef

View File

@@ -119,7 +119,7 @@ NIGHTLYRENEW(){
}
LISTCERTS(){
#DIVIDER true
DIVIDER true
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)
@@ -130,7 +130,7 @@ LISTCERTS(){
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)));
DIVIDER true
#DIVIDER true
#echo -e "Certificate Subject: ${idsST[Bold]}${idsBG[Blue]}${SUBJECT}${idsST[Reset]}${idsBG[Default]}"
#if [ "$SUBJECTNAMES" != "" ]; then
# echo -e "Alternate Subject(s): ${idsCL[Cyan]}${SUBJECTNAMES}${idsCL[Default]}"
@@ -157,10 +157,9 @@ LISTCERTS(){
else
date="${idsCL[Green]}$(date -d @${CERTEXPIRE} '+%m-%d-%Y')${idsCL[Default]}"
fi
echo -e "${idsCL[Cyan]}${SUBJECT}${spc}${date} ${idsCL[Cyan]}${SUBJECTNAMES}${idsCL[Default]}"
echo
echo -e "${idsCL[Cyan]}${SUBJECT}${spc}${date} ${idsCL[Cyan]}${SUBJECTNAMES}${idsCL[Default]}"
done
echo
if [ -z $action ] || [ "${action}" = "gui" ]; then
DIVIDER true
ENTER2CONTINUE