diff --git a/defaults.inc b/defaults.inc index 3a54f59a..fb8af6aa 100755 --- a/defaults.inc +++ b/defaults.inc @@ -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 ' diff --git a/inc/certs.inc b/inc/certs.inc index 9a2d7e8f..a58baaed 100755 --- a/inc/certs.inc +++ b/inc/certs.inc @@ -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]}" diff --git a/inc/sites.inc b/inc/sites.inc index d2b4888c..a1b7a1b8 100755 --- a/inc/sites.inc +++ b/inc/sites.inc @@ -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