Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-11 11:27:44 -06:00
parent 688964785b
commit b3586c05e6

View File

@@ -581,9 +581,9 @@ 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
# for line in $(</tmp/remotessl); do
# echo "HERE: ${line}"
# done
else
NCMD=''
fi
@@ -598,7 +598,8 @@ LISTCERTS(){
for certdir in /etc/letsencrypt/live/*/ ; do
# for certdir in /etc/letsencrypt/live/*/ ; do
for certdir in $(</tmp/remotessl); do
SUBJECT=$(${NCMD} 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=${SUBJECTNAMES//$'\n'/, }