From 2a683b14240bd7d8cb483de2893d424c65c4fdc5 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 29 Nov 2024 09:22:48 -0600 Subject: [PATCH] Update status.inc --- inc/status.inc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/inc/status.inc b/inc/status.inc index d24c41f5..bebde90a 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -575,6 +575,7 @@ STATUS_NODE(){ spc=' ' fi tmp=${NM_SINGLESRVR_SERVICES[${NODETYPE}]} + SSCHK=true if [[ ${tmp[@]} =~ ${srvc} ]]; then if [[ $(${NCMD} ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${NM_SINGLESRVR_IP[${NODETYPE}]}* ]]; then SSCHK=false @@ -587,15 +588,12 @@ STATUS_NODE(){ SSCHK=false elif ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} [ -f ${NM_TMPFOLDER}/.skip ]; then - SSCHK=false + SSCHK=skip rm -f ${NM_TMPFOLDER}/${nip}~${srvc}.* - else - SSCHK=true - fi - if [ ${SSCHK} != false ]; then + if [ ${SSCHK} == true ]; then [ "${STATUS_ACTION}" != "check" ] && echo -en "${idsCL[White]} ${NM_SERVICE_DESC[${srvc}]}${spc}${idsCL[Default]}: " if [ "${NODETYPE}" != "OFW" ]; then srvctest=${srvctst[$sr]} @@ -656,6 +654,9 @@ STATUS_NODE(){ elif [ -f ${NM_TMPFOLDER}/${nip}~${srvc}.disable ] || ([ "${nip}" != "10.2.1.5" ] && [[ "${nip}" = *"10.2."* ]] && [ -f ${PW_TMPFOLDER}/OFF-vMS-Host1.down ]) || ([ "${srvc}" == "keepalived" ] && [ "${nip}" == "10.2.1.51" ]); then echo -e "${idsCL[White]} ${NM_SERVICE_DESC[${srvc}]}${spc}${idsCL[Default]}: ${idsCL[LightCyan]}Disabled${idsCL[Default]}" + + elif [ "${SSCHK}" == "skip" ]; then + echo -e "${idsCL[White]} ${NM_SERVICE_DESC[${srvc}]}${spc}${idsCL[Default]}: ${idsCL[LightCyan]}Host Disabled${idsCL[Default]}" else echo -e "${idsCL[White]} ${NM_SERVICE_DESC[${srvc}]}${spc}${idsCL[Default]}: ${idsCL[LightCyan]}Disabled - Secondary Node${idsCL[Default]}" @@ -684,6 +685,7 @@ STATUS_NODE(){ spc=' ' fi tmp=${NM_SINGLESRVR_DOCKERS[${NODETYPE}]} + SDCHK=true if [[ ${tmp[@]} =~ ${docker} ]]; then if [[ $(${NCMD} ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | awk '/inet/ {print $2}' | cut -d'/' -f1) != *${NM_SINGLESRVR_IP[${NODETYPE}]}* ]]; then SDCHK=false @@ -693,14 +695,11 @@ STATUS_NODE(){ fi elif ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} [ -f ${NM_TMPFOLDER}/.skip ]; then - SDCHK=false + SDCHK=skip rm -f ${NM_TMPFOLDER}/${nip}~${docker}.* - else - SDCHK=true - fi - if [ ${SDCHK} != false ]; then + if [ ${SDCHK} == true ]; then [ "${STATUS_ACTION}" != "check" ] && echo -en "${idsCL[White]} ${NM_DOCKER_DESC[${docker}]}$spc${idsCL[Default]}: " if [ ! "$(${NCMD} docker ps -q -f name=${docker})" ]; then @@ -770,6 +769,9 @@ STATUS_NODE(){ fi fi [ "${SDCHK}" == "primary" ] && echo -e "${idsCL[LightCyan]} - Primary Node${idsCL[Default]}" || echo -e "${idsCL[Default]}" + + elif [ "${SDCHK}" == "skip" ]; then + echo -e "${idsCL[White]} ${NM_DOCKER_DESC[${docker}]}${spc}${idsCL[Default]}: ${idsCL[LightCyan]}Host Disabled${idsCL[Default]}" else echo -e "${idsCL[White]} ${NM_DOCKER_DESC[${docker}]}${spc}${idsCL[Default]}: ${idsCL[LightCyan]}Disabled - Secondary Node${idsCL[Default]}" fi