From 30f19f20c40e6cee4a7f0722ba39d42e68b0e335 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Wed, 6 Dec 2023 23:45:28 -0600 Subject: [PATCH] Update status.inc --- inc/status.inc | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/inc/status.inc b/inc/status.inc index 5f406a98..27923337 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -2,18 +2,42 @@ STATUS(){ start=$(date +%s) log_start=$(date "+%Y-%m-%d %H:%M:%S") + + if [ "${1}" == "status" ] && [ "${2}" == "report" ] + if [ "${NM_NODETYPES[${ST_ACTION^^}]}" != "" ]; then + ntss=${ST_ACTION^^} + ntypesel=(${ntss}) + ST_ACTION=${2} + else + ntss="" + ntypesel=(${NM_NODE_TYPES[@]}) + [ "${1}" == "sync" ] && ST_ACTION=repl || ST_ACTION=${1} + fi + else + while [ $# -gt 0 ]; do + case "$1" in + -site) DEL_SITE=${2};; + -ssl) DEL_SSL=${2};; + -*) + echo -e "Usage: ${idsCL[Yellow]}[nodemgmt or nmg] status {opt}${idsCL[Default]} {" + width=35 + printf "%-${width}s- %s\n" " -site {FQDN address}" "(*required)" + printf "%-${width}s- %s\n" " -site {FQDN address}" "(*required)" + printf "%-${width}s- %s\n" " -site {FQDN address}" "(*required)" + printf "%-${width}s- %s\n" " -ssl {yes or [no]}" "Delete SSL certs as well" + printf "%-${width}s- %s\n" " -list" "List sites (same as running nodemgmt delsites)" + echo -e "}\n" + exit 0 + ;; + esac + shift + done + fi + PRI_CW=40 declare -i cw; declare -i spc1; declare -i c - if [ "${NM_NODETYPES[${ST_ACTION^^}]}" != "" ]; then - ntss=${ST_ACTION^^} - ntypesel=(${ntss}) - ST_ACTION=${2} - else - ntss="" - ntypesel=(${NM_NODE_TYPES[@]}) - [ "${1}" == "sync" ] && ST_ACTION=repl || ST_ACTION=${1} - fi + ############################ ## REPLICATION CHECK SETUP