From 1c188df3406be06750ba4e69c7f658a05356aa2b Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 25 May 2023 18:23:22 -0500 Subject: [PATCH] Update sites.inc --- inc/sites.inc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/inc/sites.inc b/inc/sites.inc index 10b263f4..e6b02593 100755 --- a/inc/sites.inc +++ b/inc/sites.inc @@ -466,12 +466,11 @@ SITEINFO(){ fi gosite=${NODE_TYPE}_NGINX_SITES - + declare -A SITELIST if [ "${!gosite}" != "" ]; then sites=$(find ${!gosite}/*); i=0 for sitefile in ${sites[@]}; do site=${sitefile##*/}; site=${site/.conf/} - if (( i % 12 == 0 )) || [ $i = 0 ]; then DIVIDER false yellow 98 msg1="Site Address"; # c=0; spc1=''; spct=$((${cw_spc1}-${#msg1})); until [ $c = ${spct} ]; do spc1="${spc1} "; c=`expr $c + 1`; done @@ -483,7 +482,7 @@ SITEINFO(){ msg7="Proxy Address & Port"; # echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${msg1}${spc1}${msg2}${spc2}${msg3}${spc3}${msg4}${spc4}${msg5}${spc5}${msg6}${spc6}${msg7}${idsST[Reset]}${idsCL[Default]}" echo -en "${idsST[Bold]}${idsCL[LightCyan]}" - printf "%-30s %-10s %-7s %-7s %-7s %-8s %-15s\n" "## ${msg1}" "${msg2}" "${msg3}" "${msg4}" "${msg5}" "${msg6}" "${msg7}" + printf "%-30s %-10s %-7s %-7s %-7s %-8s %-15s\n" "##) ${msg1}" "${msg2}" "${msg3}" "${msg4}" "${msg5}" "${msg6}" "${msg7}" echo -en "${idsST[Reset]}${idsCL[Default]}" DIVIDER false yellow 98 else @@ -515,6 +514,7 @@ SITEINFO(){ # msg6="${lock}"; c=0; spc6=''; spct=$((${cw_spc6}-${#msg6})); until [ $c = ${spct} ]; do spc6="${spc6} "; c=`expr $c + 1`; done # msg7="${proxyhost}"; i=`expr $i + 1` + SITELIST[${i}]=${site} [ ${i} -lt 10 ] && ii=" ${i}" || ii=${i} # echo -e "${ii}) ${msg1}${spc1}${msg2}${spc2}${msg3}${spc3}${msg4}${spc4}${msg5}${spc5}${msg6}${spc6}${msg7}" @@ -523,11 +523,10 @@ SITEINFO(){ done if [ "${1}" == "edit" ]; then - echo -en "${idsCL[LightCyan]}Enter the site number you want to edit: ${idsCL[Default]}" + echo -en "\n${idsCL[LightCyan]}Enter the site number you want to edit: ${idsCL[Default]}" read siteid - - site=${sites[`expr $siteid - 1`]##*/}; site=${site/.conf/} - echo $site + # site=${sites[${siteid}]}; site=${site/.conf/} + echo ${sites[${siteid}]} fi