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