From 32ec308187a9cb16fe2ef2f7e0a4a1f66b196b5c Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 11 Feb 2019 14:01:30 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 93137650..b419e9da 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -611,13 +611,15 @@ LISTCERTS(){ 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'); - echo 'yes' + SUBJECTNAMES=${SUBJECTNAMES//$'\n'/, } SUBJECTNAMES=$(echo $SUBJECTNAMES | sed "s/${SUBJECT}, //g") SUBJECTNAMES=$(echo $SUBJECTNAMES | sed "s/, ${SUBJECT}//g") SUBJECTNAMES=$(echo $SUBJECTNAMES | sed "s/${SUBJECT}//g") IFS=', '; SUBJECT_NAMES=(${SUBJECTNAMES}); unset IFS DAYS=14; DUEIN=$(($(date +%s) + (86400*$DAYS))); + echo 'yes' + c=0; cw=26; spc='' spc1=${cw}-${#SUBJECT}