From 99821a9abad603e5dfb35bc13164c757b266dd87 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 8 Feb 2019 15:52:03 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 249bc5be..fc72ccf4 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -1173,10 +1173,12 @@ SERVICE(){ $NCMD systemctl $2 $1 if [[ "enable,disable" = *"${2}"* ]] || [ "${1}" = "daemon-reload" ]; then echo -e "${idsCL[Green]}OK${idsCL[Default]}" - elif [[ $(${NCMD} pgrep ${1} | wc -l) -gt "0" ]]; then + elif [ "$(${NCMD} systemctl is-active ${1})" != "active" ]; then echo -e "${idsCL[Green]}OK${idsCL[Default]}" - elif [ "$2" = "stop" ]; then echo -e "${idsCL[Red]}STOPPED${idsCL[Default]}" - else echo -e "${idsCL[Red]}ERROR${idsCL[Default]}" + elif [ "$2" = "stop" ]; then + echo -e "${idsCL[Red]}STOPPED${idsCL[Default]}" + else + echo -e "${idsCL[Red]}ERROR${idsCL[Default]}" fi nid=`expr $nid + 1` done