From 40ca4b32ef95726ea86f12369958b3b389cf4cc5 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 7 Feb 2019 12:25:04 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 74f46ecb..54b49668 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -50,9 +50,12 @@ STATUS() { spc1=${cw}-${#NM_SERVICES[${srvc}]} until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done echo -en " ${NM_SERVICES[${srvc}]}$spc: " - if [ $(pgrep ${srvc} | wc -l) -gt "0" ]; then + if [ $(pgrep ${srvc} | wc -l) -lt "1" ]; then + echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" + touch ${FOLDER}/localhost-${srvc}.down + elif [ -f ${FOLDER}/localhost-${srvc}.down ]; then echo -e "${idsCL[Green]}Running${idsCL[Default]}" - else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" + rm -f ${FOLDER}/localhost-${srvc}.down fi done echo @@ -71,9 +74,12 @@ STATUS() { spc1=${cw}-${#NM_SERVICES[${srvc}]} until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done echo -en " ${NM_SERVICES[${srvc}]}$spc: " - if [ $(${NCMD} pgrep ${srvc} | wc -l) -gt "0" ]; then + if [ $(${NCMD} pgrep ${srvc} | wc -l) -lt "1" ]; then + echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" + touch ${FOLDER}/${nip}-${srvc}.down + elif [ -f ${FOLDER}/${nip}-${srvc}.down ]; then echo -e "${idsCL[Green]}Running${idsCL[Default]}" - else echo -e "${idsCL[Red]}Not Running${idsCL[Default]}" + rm -f ${FOLDER}/${nip}-${srvc}.down fi done echo