Update sites.inc
This commit is contained in:
@@ -466,12 +466,11 @@ SITEINFO(){
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
gosite=${NODE_TYPE}_NGINX_SITES
|
gosite=${NODE_TYPE}_NGINX_SITES
|
||||||
|
declare -A SITELIST
|
||||||
if [ "${!gosite}" != "" ]; then
|
if [ "${!gosite}" != "" ]; then
|
||||||
sites=$(find ${!gosite}/*); i=0
|
sites=$(find ${!gosite}/*); i=0
|
||||||
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
|
||||||
DIVIDER false yellow 98
|
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
|
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";
|
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 -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]}"
|
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]}"
|
echo -en "${idsST[Reset]}${idsCL[Default]}"
|
||||||
DIVIDER false yellow 98
|
DIVIDER false yellow 98
|
||||||
else
|
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
|
# msg6="${lock}"; c=0; spc6=''; spct=$((${cw_spc6}-${#msg6})); until [ $c = ${spct} ]; do spc6="${spc6} "; c=`expr $c + 1`; done
|
||||||
# msg7="${proxyhost}";
|
# msg7="${proxyhost}";
|
||||||
i=`expr $i + 1`
|
i=`expr $i + 1`
|
||||||
|
SITELIST[${i}]=${site}
|
||||||
[ ${i} -lt 10 ] && ii=" ${i}" || ii=${i}
|
[ ${i} -lt 10 ] && ii=" ${i}" || ii=${i}
|
||||||
# echo -e "${ii}) ${msg1}${spc1}${msg2}${spc2}${msg3}${spc3}${msg4}${spc4}${msg5}${spc5}${msg6}${spc6}${msg7}"
|
# echo -e "${ii}) ${msg1}${spc1}${msg2}${spc2}${msg3}${spc3}${msg4}${spc4}${msg5}${spc5}${msg6}${spc6}${msg7}"
|
||||||
|
|
||||||
@@ -523,11 +523,10 @@ SITEINFO(){
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ "${1}" == "edit" ]; then
|
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
|
read siteid
|
||||||
|
# site=${sites[${siteid}]}; site=${site/.conf/}
|
||||||
site=${sites[`expr $siteid - 1`]##*/}; site=${site/.conf/}
|
echo ${sites[${siteid}]}
|
||||||
echo $site
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user