Update nodemgmt-scripts.sh
This commit is contained in:
@@ -592,6 +592,21 @@ LISTCERTS(){
|
|||||||
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');
|
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)));
|
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 | grep 'Not After')
|
||||||
|
COMMONNAME=$(${OPENSSL} x509 -in ${certdir}/cert.pem -text -subject -noout -inform pem | \
|
||||||
|
${SED} -e 's/.*CN=//' | \
|
||||||
|
${SED} -e 's/\/.*//')
|
||||||
|
|
||||||
|
SUBJECT=${COMMONNAME}
|
||||||
|
|
||||||
|
|
||||||
declare -i cw; declare -i spc1; declare -i c
|
declare -i cw; declare -i spc1; declare -i c
|
||||||
c=0; cw=30; spc=''
|
c=0; cw=30; spc=''
|
||||||
@@ -602,7 +617,7 @@ LISTCERTS(){
|
|||||||
else
|
else
|
||||||
date="${idsCL[Green]}$(date -d @${CERTEXPIRE} '+%m-%d-%Y')${idsCL[Default]}"
|
date="${idsCL[Green]}$(date -d @${CERTEXPIRE} '+%m-%d-%Y')${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
echo -e "${idsCL[Cyan]}${SUBJECT}${spc}${date} ${idsCL[Cyan]}${SUBJECTNAMES}${idsCL[Default]}"
|
echo -e "${idsCL[Cyan]}${SUBJECT}${spc}${CERTDATE} ${idsCL[Cyan]}${SUBJECTNAMES}${idsCL[Default]}"
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user