This commit is contained in:
2025-06-01 13:49:39 -05:00
parent 465bbc0ec1
commit dbf0c65d41
3 changed files with 8 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
VERS='5.5.12-06012025'
VERS='5.5.13-06012025'
NM_BETA=false
noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update log betacheck offsite-staticroute-fix '

View File

@@ -5,7 +5,7 @@ CERTSERVER="https://acme-v02.api.letsencrypt.org/directory"
CERTCHAIN="ISRG Root X1"
NEWCERT(){
CERTTEST=0; CERTEXPAND=""; CERTENC='ecdsa'
CERTTEST=0; CERTEXPAND=""; CERTENC='ecdsa'; NONGINXRESTART=0
if [ "${3}" != "" ] && ([ "${3}" == "0" ] || [ "${3}" == "1" ]); then
NEW_CERT=${1}
NEWSITE=${2}
@@ -17,6 +17,7 @@ NEWCERT(){
-newsite) NEWSITE=true;;
-expand) CERTEXPAND='--expand';;
-rsa) CERTENC='rsa';;
-nnr) NONGINXRESTART=1;;
-h|-help|--help)
echo -e "Usage: ${idsCL[Yellow]}[nodemgmt or nmg] newcert {hostname}${idsCL[Default]} {"
width=35
@@ -84,16 +85,8 @@ NEWCERT(){
sed -i "s/#include conf.d\/include\/ssl-ciphers.conf/include conf.d\/include\/ssl-ciphers.conf/g" ${NM_NGINXPATH}/sites-available/${MAIN_CERT}.conf
sed -i "s/#include conf.d\/include\/force-ssl.conf/include conf.d\/include\/force-ssl.conf/g" ${NM_NGINXPATH}/sites-available/${MAIN_CERT}.conf
DIVIDER true
# if [ "${NEWSITE}" != "true" ]; then
# echo -e -n "${idsCL[LightCyan]}Restart NGINX on all Nodes (Y/n): ${idsCL[Default]}"
# read -n 1 NGINXRELOAD
# if [[ ${NGINXRELOAD} =~ ^[Nn]$ ]]; then
# tmp=''
# else
# echo
SERVICE_MGMT nginx restart
# fi
# fi
[ ${NONGINXRESTART} -eq 0 ] && SERVICE_MGMT nginx restart
fi
echo
echo -e "${idsCL[Green]}Certificate has been successfully created for '${idsCL[Yellow]}${NEW_CERT}${idsCL[Green]}'...${idsCL[Default]}"

View File

@@ -425,14 +425,14 @@ NEWPROXYSITE_CREATE(){
DEL-SSL ${SITENAME} >/dev/null 2>&1
echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}\n"
echo -en "\n${idsCL[LightCyan]}Requesting new SSL Cert ... "
NEWCERT ${CERTTEST}-expand -newsite ${NGINX_SERVERNAME} ###>/dev/null 2>&1
NEWCERT ${CERTTEST}-expand -nnr -newsite ${NGINX_SERVERNAME} ###>/dev/null 2>&1
echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}\n"
# sed -i "s/live\/${SITENAME}\//live\/${MAIN_SITE}\//g" ${nginxconfig}
sed -i "s/\/${SITENAME}/\/${MAIN_SITE}/g" ${nginxconfig}
elif [ "${oldservernames}" != "${NGINX_SERVERNAME}" ]; then
echo -en "\n${idsCL[LightCyan]}Updating SSL Cert for hostname changes ... "
NEWCERT ${CERTTEST}-expand -newsite ${NGINX_SERVERNAME} ###>/dev/null 2>&1
NEWCERT ${CERTTEST}-expand -nnr -newsite ${NGINX_SERVERNAME} ###>/dev/null 2>&1
echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}\n"
fi
@@ -449,7 +449,7 @@ NEWPROXYSITE_CREATE(){
if [ ! -f ${NM_CERTPATH}/live/${MAIN_SITE}/cert.pem ]; then
echo -e "\n${idsCL[LightCyan]}No SSL cert detected, will generate one now ... "
SERVICE_MGMT nginx restart
NEWCERT ${CERTTEST}-newsite ${NGINX_SERVERNAME}
NEWCERT ${CERTTEST}-newsite -nnr ${NGINX_SERVERNAME}
echo
fi
if [ -f ${NM_CERTPATH}/live/${MAIN_SITE}/cert.pem ]; then