From 9d1081294536c7cc3711adaed40993f4e9993902 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 10 Feb 2019 16:52:43 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 1755a057..3c96a226 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -593,15 +593,21 @@ 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))); + AWK=$(which awk) + DATE=$(which date) + GREP=$(which grep) OPENSSL=$(which openssl) - CERTDATE=$(${OPENSSL} x509 -in ${certdir}/cert.pem -text -enddate -noout -inform pem | \ - ${SED} 's/notAfter\=//') + SED=$(which sed) + + + CERTDATE=$(${OPENSSL} x509 -in ${certdir}/cert.pem -text -enddate -noout -inform pem | ${SED} 's/notAfter\=//') 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 c=0; cw=30; spc='' spc1=${cw}-${#SUBJECT}