Update sites.inc

This commit is contained in:
2023-11-12 13:55:14 -06:00
parent fa2130940f
commit bf2b54a802

View File

@@ -489,7 +489,7 @@ NEWPROXYSITE_CREATE(){
MAIN_SITE=${SERVERNAMES} MAIN_SITE=${SERVERNAMES}
NGINX_SERVERNAME=${SERVERNAMES} NGINX_SERVERNAME=${SERVERNAMES}
fi fi
nginxconfig=${NM_NGINXPATH}/sites-enabled/${SITENAME}.conf nginxconfig=${NM_NGINXPATH}/sites-enabled/${SITENAME,,}.conf
if [ "${MAIN_SITE}" != "${SITENAME}" ] && [ -f ${nginxconfig} ]; then if [ "${MAIN_SITE}" != "${SITENAME}" ] && [ -f ${nginxconfig} ]; then
echo -e "\n${idsCL[LightRed]}New site name already exists!${idsCL[Default]}\n" echo -e "\n${idsCL[LightRed]}New site name already exists!${idsCL[Default]}\n"
exit 1 exit 1
@@ -634,8 +634,13 @@ SITEINFO(){
gosite=${NM_NGINXPATH[${RUN_NODE_TYPE}]}/sites-enabled gosite=${NM_NGINXPATH[${RUN_NODE_TYPE}]}/sites-enabled
declare -A SITELIST declare -A SITELIST
if [ "${gosite}" != "" ]; then if [ "${gosite}" != "" ]; then
sites=$(find ${gosite}/*.conf); i=0 if [ "${1}" != "" ] && [ "${1}" != "edit" ]; then
if [ "${1}" == "" ] || ([ "${1}" == "edit" ] && [ "${2}" == "" ]); then sites=$(find ${gosite}/*${1,,}*.conf)
else
sites=$(find ${gosite}/*.conf)
fi
i=0
# if [ "${1}" == "" ] || ([ "${1}" == "edit" ] && [ "${2}" == "" ]); then
for sitefile in ${sites[@]}; do for sitefile in ${sites[@]}; do
site=${sitefile##*/}; site=${site/.conf/} site=${sitefile##*/}; site=${site/.conf/}
if (( i % 12 == 0 )) || [ $i = 0 ]; then if (( i % 12 == 0 )) || [ $i = 0 ]; then
@@ -705,14 +710,14 @@ SITEINFO(){
SITELIST[${i}]=${site} SITELIST[${i}]=${site}
i=`expr $i + 1` i=`expr $i + 1`
done done
else # else
i=0 # i=0
for sitefile in ${sites[@]}; do # for sitefile in ${sites[@]}; do
site=${sitefile##*/}; site=${site/.conf/} # site=${sitefile##*/}; site=${site/.conf/}
SITELIST[${i}]=${site} # SITELIST[${i}]=${site}
i=`expr $i + 1` # i=`expr $i + 1`
done # done
fi # fi
if [ "${1}" == "edit" ]; then if [ "${1}" == "edit" ]; then