Update nodemgmt-scripts.sh
This commit is contained in:
@@ -1004,13 +1004,6 @@ LISTCERTS_NPM(){
|
|||||||
}
|
}
|
||||||
COPYCERTS_NPM(){
|
COPYCERTS_NPM(){
|
||||||
ssldir='/opt/nginx-proxy/ssl'
|
ssldir='/opt/nginx-proxy/ssl'
|
||||||
|
|
||||||
olddirs=$(find $ssldir -type l ! -exec test -e {} \; -print)
|
|
||||||
for od in ${olddirs[@]}; do
|
|
||||||
echo "Removing old folder ... ${od}"
|
|
||||||
rm -f $od
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ! -z ${LOCAL_SERVICES+x} ]; then
|
if [ ! -z ${LOCAL_SERVICES+x} ]; then
|
||||||
NCMD="ssh root@${LB_HOSTS[0]}"
|
NCMD="ssh root@${LB_HOSTS[0]}"
|
||||||
${NCMD} rm -f /tmp/ssllist
|
${NCMD} rm -f /tmp/ssllist
|
||||||
@@ -1020,19 +1013,33 @@ COPYCERTS_NPM(){
|
|||||||
rm -f /tmp/ssllist
|
rm -f /tmp/ssllist
|
||||||
for certdir in /opt/nginx-proxy/letsencrypt/live/*/ ; do echo $certdir; done > /tmp/ssllist
|
for certdir in /opt/nginx-proxy/letsencrypt/live/*/ ; do echo $certdir; done > /tmp/ssllist
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${1}" = "reset" ]; then
|
||||||
|
echo "Resetting ... Deleting all SSL symlink folders"
|
||||||
|
for certdir in $(</tmp/ssllist); do
|
||||||
|
rm -f $certdir
|
||||||
|
done
|
||||||
|
else
|
||||||
|
olddirs=$(find $ssldir -type l ! -exec test -e {} \; -print)
|
||||||
|
for od in ${olddirs[@]}; do
|
||||||
|
echo "Removing old folder ... ${od}"
|
||||||
|
rm -f $od
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
DIVIDER true
|
DIVIDER true
|
||||||
fi
|
fi
|
||||||
#echo
|
|
||||||
|
# for certdir in $(</tmp/ssllist); do
|
||||||
|
# SUBJECT=$(${NCMD} openssl x509 -in ${certdir}cert.pem -noout -subject|grep -oP '(?<=CN = )[^,]+'|sort -uV)
|
||||||
|
# #echo ${ssldir}/${SUBJECT}
|
||||||
|
# if [ ! -L ${ssldir}/${SUBJECT} ]; then
|
||||||
|
# echo "${SUBJECT} ... creating"
|
||||||
|
# /bin/ln -s ${certdir} ${ssldir}/${SUBJECT}
|
||||||
|
# fi
|
||||||
|
# done
|
||||||
|
|
||||||
for certdir in $(</tmp/ssllist); do
|
|
||||||
SUBJECT=$(${NCMD} openssl x509 -in ${certdir}cert.pem -noout -subject|grep -oP '(?<=CN = )[^,]+'|sort -uV)
|
|
||||||
#echo ${ssldir}/${SUBJECT}
|
|
||||||
if [ ! -L ${ssldir}/${SUBJECT} ]; then
|
|
||||||
echo "${SUBJECT} ... creating"
|
|
||||||
/bin/ln -s ${certdir} ${ssldir}/${SUBJECT}
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
if [ -z $action ] || [ "${action}" = "gui" ]; then
|
||||||
echo
|
echo
|
||||||
DIVIDER true
|
DIVIDER true
|
||||||
@@ -2469,7 +2476,7 @@ if [ ${action-x} ]; then
|
|||||||
delssl) DEL-SSL ${2};;
|
delssl) DEL-SSL ${2};;
|
||||||
listcerts) LISTCERTS;;
|
listcerts) LISTCERTS;;
|
||||||
listcerts-npm) LISTCERTS_NPM;;
|
listcerts-npm) LISTCERTS_NPM;;
|
||||||
copynpmcerts) COPYCERTS_NPM;;
|
copynpmcerts) COPYCERTS_NPM ${2};;
|
||||||
checkcerts) CHECK-CERTS ${2};;
|
checkcerts) CHECK-CERTS ${2};;
|
||||||
nightlyrenew) NIGHTLYRENEW;;
|
nightlyrenew) NIGHTLYRENEW;;
|
||||||
delsite) DELSITE ${2} ${3} ${4} ${5};;
|
delsite) DELSITE ${2} ${3} ${4} ${5};;
|
||||||
|
|||||||
Reference in New Issue
Block a user