From 3e55957a14e2e63525e8c09534259878098a7a0c Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 2 Dec 2023 14:38:44 -0600 Subject: [PATCH] Update sites.inc --- inc/sites.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/sites.inc b/inc/sites.inc index e6bdcaba..cb5f8dcb 100755 --- a/inc/sites.inc +++ b/inc/sites.inc @@ -560,9 +560,9 @@ SITEINFO(){ gosite=${NM_NGINXPATH[${RUN_NODE_TYPE}]}/sites-enabled declare -A SITELIST if [ "${gosite}" != "" ]; then - [ "${SEARCH}" != "0" ] && siteslist=$(find ${gosite}/*${SEARCH,,}*.conf) || siteslist=$(find ${gosite}/*.conf) - echo "HERE: '$siteslist'" - if [ "${siteslist}" != "" ]; then + [ "${SEARCH}" != "0" ] && files=$(shopt -s nullglob dotglob; echo ${gosite}/*${SEARCH,,}*.conf) || files=$(shopt -s nullglob dotglob; echo ${gosite}/*.conf) + if (( ${#files} )); then + [ "${SEARCH}" != "0" ] && siteslist=$(find ${gosite}/*${SEARCH,,}*.conf) || siteslist=$(find ${gosite}/*.conf) i=1 for sitefile in ${siteslist[@]}; do SITENAME=${sitefile##*/}; SITENAME=${SITENAME/.conf/}