Update nodemgmt-scripts.sh
This commit is contained in:
@@ -88,7 +88,7 @@ LISTCERTS(){
|
|||||||
for certdir in /etc/letsencrypt/live/*/ ; do
|
for certdir in /etc/letsencrypt/live/*/ ; do
|
||||||
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)
|
||||||
IFS=':'; SUBJECTNAMES=(${SUBJECTNAMES//$'\n'/:}); unset IFS
|
IFS=','; SUBJECTNAMES=(${SUBJECTNAMES//$'\n'/,}); 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');
|
||||||
DAYS=14; DUEIN=$(($(date +%s) + (86400*$DAYS)));
|
DAYS=14; DUEIN=$(($(date +%s) + (86400*$DAYS)));
|
||||||
|
|
||||||
@@ -110,6 +110,8 @@ LISTCERTS(){
|
|||||||
echo -e "Expiration Date: ${idsCL[Green]}$(date -d @${CERTEXPIRE} '+%m-%d-%Y')${idsCL[Default]}"
|
echo -e "Expiration Date: ${idsCL[Green]}$(date -d @${CERTEXPIRE} '+%m-%d-%Y')${idsCL[Default]}"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
echo
|
||||||
|
echo ""
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user