This commit is contained in:
2023-11-12 14:04:15 -06:00
parent bf2b54a802
commit aff13a0daf
2 changed files with 85 additions and 85 deletions

View File

@@ -7,7 +7,7 @@ NEWCERT(){
else
while [ $# -gt 0 ]; do
case "${1}" in
-test) CERTTEST=1;;
-test|-t) CERTTEST=1;;
*) NEW_CERT=${1};;
esac
shift

View File

@@ -165,7 +165,7 @@ NEWSITE(){
echo
while [ $# -gt 0 ]; do
case "$1" in
-test) CERTTEST=1;;
-test|-t) CERTTEST=1;;
-site) NEW_SITE=${2};;
-type) SITE_TYPE=${2};;
-ssl) CREATE_SSL=${2};;
@@ -616,6 +616,14 @@ NEWPROXYSITE_CREATE(){
SITEINFO(){
# start=`date +%s`
dl=105
EDIT=0; SEARCH=0
while [ $# -gt 0 ]; do
case "${1}" in
-edit|-e) EDIT=1;;
-search|-s) SEARCH=${2};;
esac
shift
done
if [ "${onefacline}" == "" ]; then
[ "$($NCMD /sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)" != "${NM_AUTHELIA_IP}" ] && ACMD="ssh root@${NM_AUTHELIA_IP}" || ACMD=""
@@ -626,7 +634,7 @@ SITEINFO(){
twofacline=${twofacline%%:*}
fi
if [ "${1}" == "edit" ]; then
if [ ${EDIT} -eq 1 ]; then
[ "${2}" == "" ] && echo -e "${idsCL[LightGreen]}Choose a site from the list below to edit: ${idsCL[Default]}"
else
echo -e "${idsCL[LightGreen]}Local NGINX Sites ${idsCL[Default]}"
@@ -634,20 +642,20 @@ SITEINFO(){
gosite=${NM_NGINXPATH[${RUN_NODE_TYPE}]}/sites-enabled
declare -A SITELIST
if [ "${gosite}" != "" ]; then
if [ "${1}" != "" ] && [ "${1}" != "edit" ]; then
sites=$(find ${gosite}/*${1,,}*.conf)
if [ ${SEARCH} -ne 0 ]; then
sites=$(find ${gosite}/*${SEARCH,,}*.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
DIVIDER false yellow ${dl}
[ "${1}" == "edit" ] && msg1='##) Site Address' || msg1='Site Address'
[ ${EDIT} -eq 1 ] && msg1='##) Site Address' || msg1='Site Address'
echo -en "${idsST[Bold]}${idsCL[LightCyan]}"
if [ "${1}" == "edit" ]; then
if [ ${EDIT} -eq 1 ]; then
printf "%-32s %-8s %-6s %-6s %-6s %-6s %-6s %-8s\n" "${msg1}" "Type" "SSL" "HSTS" "WBSKT" "EXPLT" "LOCK" "Proxy Connection"
else
printf "%-28s %-8s %-6s %-6s %-6s %-6s %-6s %-8s\n" "${msg1}" "Type" "SSL" "HSTS" "WBSKT" "EXPLT" "LOCK" "Proxy Connection"
@@ -700,8 +708,8 @@ SITEINFO(){
[ ${i} -lt 10 ] && ii=" ${i}" || ii=${i}
[ "${1}" == "edit" ] && msg1="${ii}) ${site}" || msg1="${site}"
if [ "${1}" == "edit" ]; then
[ ${EDIT} -eq 1 ] && msg1="${ii}) ${site}" || msg1="${site}"
if [ ${EDIT} -eq 1 ]; then
printf "%-32s %-8s %-6s %-6s %-6s %-6s %-6s %-14s\n" "${msg1}" "${type}" "${ssl}" "${hsts}" "${wbskt}" "${explt}" "${lock}" "${proxyhost}"
else
printf "%-28s %-8s %-6s %-6s %-6s %-6s %-6s %-14s\n" "${msg1}" "${type}" "${ssl}" "${hsts}" "${wbskt}" "${explt}" "${lock}" "${proxyhost}"
@@ -710,16 +718,8 @@ 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
if [ "${1}" == "edit" ]; then
if [ ${EDIT} -eq 1 ]; then
function exitspacing {
echo -e "\n\033[K\n\033[K"