Update nodemgmt-scripts.sh
This commit is contained in:
@@ -1040,6 +1040,20 @@ COPYCERTS_NPM(){
|
||||
fi
|
||||
}
|
||||
|
||||
CHECK_NPMCERTS(){
|
||||
ssls=$(find /opt/nginx-proxy/letsencrypt/live/* -type d)
|
||||
|
||||
for certdir in ${ssls[@]}; do
|
||||
SUBJECT=$(openssl x509 -in ${certdir}/cert.pem -noout -subject|grep -oP '(?<=CN = )[^,]+'|sort -uV)
|
||||
ENDDATE=$(openssl x509 -in ${certdir}/cert.pem -noout -enddate | awk -F '=' '{print $2}')
|
||||
DAYS=$(dateutils.ddiff today "$(date --date="${ENDDATE}" '+%F')" -f '%d')
|
||||
|
||||
echo "${SUBJECT} - ${ENDDATE} days remaining"
|
||||
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
CHECK-CERTS(){
|
||||
if [ "${1}" = "check" ]; then
|
||||
rm -f ${FOLDER}/ssl-cert-check.lastrun
|
||||
@@ -2469,6 +2483,7 @@ if [ ${action-x} ]; then
|
||||
listcerts) LISTCERTS;;
|
||||
listcerts-npm) LISTCERTS_NPM;;
|
||||
copynpmcerts) COPYCERTS_NPM ${2};;
|
||||
checknpmcerts) CHECK_NPMCERTS;;
|
||||
checkcerts) CHECK-CERTS ${2};;
|
||||
nightlyrenew) NIGHTLYRENEW;;
|
||||
delsite) DELSITE ${2} ${3} ${4} ${5};;
|
||||
|
||||
Reference in New Issue
Block a user