This commit is contained in:
2023-11-13 08:19:27 -06:00
parent 5fea5f37be
commit 2141e9d208
2 changed files with 60 additions and 9 deletions

View File

@@ -497,7 +497,7 @@ NEWPROXYSITE_CREATE(){
else
[ "${MAIN_SITE}" != "${SITENAME}" ] && [ -f ${NM_NGINXPATH}/sites-enabled/${SITENAME}.conf ] && mv ${NM_NGINXPATH}/sites-enabled/${SITENAME}.conf ${nginxconfig}
if [ ! -f ${nginxconfig} ]; then
echo -en "${idsCL[LightCyan]}Configuring initial NGINX Site config ... ${idsCL[Default]}"
echo -en "${idsCL[LightCyan]}Configuring initial NGINX Site config ... "
cp ${NM_FOLDER}/templates/nginx.proxy.site ${nginxconfig}
sed -i "s/<<SERVER_NAME>>/${NGINX_SERVERNAME//,/ }/g" ${nginxconfig}
sed -i "s/<<MAIN_SITE>>/${MAIN_SITE}/g" ${nginxconfig}
@@ -510,19 +510,19 @@ NEWPROXYSITE_CREATE(){
else
oldservernames=$(grep 'server_name' ${nginxconfig});oldservernames=${oldservernames//;/};oldservernames=${oldservernames#* };oldservernames=${oldservernames// /,}
if [ "${MAIN_SITE}" != "${SITENAME}" ]; then
echo -e "${idsCL[LightCyan]}Detected MAIN_SITE name change, making necesary adjustments ... ${idsCL[Default]}"
echo -e "${idsCL[LightCyan]}Detected MAIN_SITE name change, making necesary adjustments ... "
echo -en "\n${idsCL[LightCyan]}Removing old SSL Cert ... "
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 ${NGINX_SERVERNAME} >/dev/null 2>&1
NEWCERT -expand ${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 -e "\n${idsCL[LightCyan]}Updating SSL Cert for hostname changes, select 'E'xpand when prompted:"
NEWCERT ${NGINX_SERVERNAME}
echo -en "\n${idsCL[LightCyan]}Updating SSL Cert for hostname changes ... "
NEWCERT -expand ${NGINX_SERVERNAME} >/dev/null 2>&1
echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}\n"
fi