Update nodemgmt-scripts.sh
This commit is contained in:
@@ -580,13 +580,12 @@ NIGHTLYRENEW(){
|
|||||||
LISTCERTS(){
|
LISTCERTS(){
|
||||||
if [ ! -z ${LOCAL_SERVICES+x} ]; then
|
if [ ! -z ${LOCAL_SERVICES+x} ]; then
|
||||||
NCMD='ssh root@10.5.10.51'
|
NCMD='ssh root@10.5.10.51'
|
||||||
${NCMD} 'for certdir in /etc/letsencrypt/live/*/ ; do echo $certdir; done' > /tmp/remotessl
|
${NCMD} rm -f /tmp/ssllist
|
||||||
# for line in $(</tmp/remotessl); do
|
${NCMD} 'for certdir in /etc/letsencrypt/live/*/ ; do echo $certdir; done' > /tmp/ssllist
|
||||||
# echo "HERE: ${line}"
|
|
||||||
# done
|
|
||||||
else
|
else
|
||||||
NCMD=''
|
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
|
fi
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
DIVIDER true
|
DIVIDER true
|
||||||
@@ -597,10 +596,7 @@ LISTCERTS(){
|
|||||||
echo -e "Subject Name Expires Alternate Subjects"
|
echo -e "Subject Name Expires Alternate Subjects"
|
||||||
DIVIDER
|
DIVIDER
|
||||||
|
|
||||||
|
for certdir in $(</tmp/ssllist); 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)
|
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=$(${NCMD} openssl x509 -in ${certdir}/cert.pem -noout -text|grep -oP '(?<=DNS:|IP Address:)[^,]+'|sort -uV)
|
||||||
SUBJECTNAMES=${SUBJECTNAMES//$'\n'/, }
|
SUBJECTNAMES=${SUBJECTNAMES//$'\n'/, }
|
||||||
|
|||||||
Reference in New Issue
Block a user