Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-05 00:08:34 -06:00
parent cd0c5fdbed
commit a8bd92f126

View File

@@ -85,7 +85,7 @@ CERTRENEW(){
LISTCERTS(){
#DIVIDER true
for certdir in /etc/letsencrypt/temp/*/ ; do
for certdir in /etc/letsencrypt/live/*/ ; do
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=${SUBJECTNAMES//$'\n'/,}
@@ -116,12 +116,12 @@ LISTCERTS(){
echo ""
if [ "${#SUBJECT_NAMES[*]}" -gt 1 ]; then
$CERT_DAEMON certonly --webroot -w /var/www/html -d ${SUBJECT},${SUBJECTNAMES2}
else
$CERT_DAEMON certonly --webroot -w /var/www/html -d ${SUBJECT}
fi
echo ""
#if [ "${#SUBJECT_NAMES[*]}" -gt 1 ]; then
# $CERT_DAEMON certonly --webroot -w /var/www/html -d ${SUBJECT},${SUBJECTNAMES2}
#else
# $CERT_DAEMON certonly --webroot -w /var/www/html -d ${SUBJECT}
#fi
#echo ""
done