Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-11 11:32:39 -06:00
parent fdf471db8c
commit 2cb37d34f3

View File

@@ -580,13 +580,12 @@ NIGHTLYRENEW(){
LISTCERTS(){
if [ ! -z ${LOCAL_SERVICES+x} ]; then
NCMD='ssh root@10.5.10.51'
${NCMD} 'for certdir in /etc/letsencrypt/live/*/ ; do echo $certdir; done' > /tmp/remotessl
# for line in $(</tmp/remotessl); do
# echo "HERE: ${line}"
# done
${NCMD} rm -f /tmp/ssllist
${NCMD} 'for certdir in /etc/letsencrypt/live/*/ ; do echo $certdir; done' > /tmp/ssllist
else
NCMD=''
for certdir in /etc/letsencrypt/live/*/ ; do echo $certdir; done > /tmp/remotessl
rm -f /tmp/ssllist
for certdir in /etc/letsencrypt/live/*/ ; do echo $certdir; done > /tmp/ssllist
fi
if [ -z $action ] || [ "${action}" = "gui" ]; then
DIVIDER true
@@ -597,10 +596,7 @@ LISTCERTS(){
echo -e "Subject Name Expires Alternate Subjects"
DIVIDER
# for certdir in /etc/letsencrypt/live/*/ ; do
for certdir in $(</tmp/remotessl); do
for certdir in $(</tmp/ssllist); do
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)
SUBJECTNAMES=${SUBJECTNAMES//$'\n'/, }