Update nodemgmt-scripts.sh
This commit is contained in:
@@ -89,10 +89,9 @@ LISTCERTS(){
|
|||||||
SUBJECT=$(openssl x509 -in ${certdir}/cert.pem -noout -subject|grep -oP '(?<=CN = )[^,]+'|sort -uV)
|
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=$(openssl x509 -in ${certdir}/cert.pem -noout -text|grep -oP '(?<=DNS:|IP Address:)[^,]+'|sort -uV)
|
||||||
SUBJECTNAMES=${SUBJECTNAMES//$'\n'/,}
|
SUBJECTNAMES=${SUBJECTNAMES//$'\n'/,}
|
||||||
SUBJECTNAMES2=$(echo $SUBJECTNAMES | sed "s/${SUBJECT},//g")
|
SUBJECTNAMES=$(echo $SUBJECTNAMES | sed "s/${SUBJECT},//g")
|
||||||
SUBJECTNAMES2=$(echo $SUBJECTNAMES2 | sed "s/,${SUBJECT}//g")
|
SUBJECTNAMES=$(echo $SUBJECTNAMES | sed "s/,${SUBJECT}//g")
|
||||||
SUBJECTNAMES2=$(echo $SUBJECTNAMES2 | sed "s/${SUBJECT}//g")
|
SUBJECTNAMES=$(echo $SUBJECTNAMES | sed "s/${SUBJECT}//g")
|
||||||
echo $SUBJECTNAMES2
|
|
||||||
|
|
||||||
IFS=','; SUBJECT_NAMES=(${SUBJECTNAMES}); unset IFS
|
IFS=','; SUBJECT_NAMES=(${SUBJECTNAMES}); unset IFS
|
||||||
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');
|
||||||
@@ -102,7 +101,7 @@ LISTCERTS(){
|
|||||||
echo -e "Certificate Subject: ${idsST[Bold]}${idsBG[Blue]}${SUBJECT}${idsST[Reset]}${idsBG[Default]}"
|
echo -e "Certificate Subject: ${idsST[Bold]}${idsBG[Blue]}${SUBJECT}${idsST[Reset]}${idsBG[Default]}"
|
||||||
if [ "${#SUBJECT_NAMES[*]}" -gt 1 ]; then
|
if [ "${#SUBJECT_NAMES[*]}" -gt 1 ]; then
|
||||||
anid=1
|
anid=1
|
||||||
for ALTNAME in "${SUBJECT_NAMES2[@]}"; do
|
for ALTNAME in "${SUBJECT_NAMES[@]}"; do
|
||||||
if [ "${anid}" = 1 ]; then alttitle='Alternate Subject(s):'; else alttitle=' '; fi
|
if [ "${anid}" = 1 ]; then alttitle='Alternate Subject(s):'; else alttitle=' '; fi
|
||||||
echo -e "${alttitle} ${idsCL[LightCyan]}${ALTNAME}${idsCL[Default]}"
|
echo -e "${alttitle} ${idsCL[LightCyan]}${ALTNAME}${idsCL[Default]}"
|
||||||
anid=`expr $anid + 1`
|
anid=`expr $anid + 1`
|
||||||
|
|||||||
Reference in New Issue
Block a user