Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-07 12:25:04 -06:00
parent e6312b3468
commit 40ca4b32ef

View File

@@ -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