From 9f70e61abc7d57cac67ea6cfc2f56202b52d7364 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 29 Jan 2019 12:00:44 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 34b84bab..1ba61f72 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -14,7 +14,7 @@ source /opt/idssys/nodemgmt/defaults.inc case "$1" in service) containsElement "${2}" "${NODE_SERVICES[@]}" - if [[ "start,stop,restart,enable,disable" != *"${3}"* ]] && [ "${2}" != "reload-daemon" ]; then + if [[ "start,stop,restart,enable,disable" != *"${3}"* ]] && [ "${2}" != "daemon-reload" ]; then echo -e "${idsCL[Red]}(${3}) is not an allowed service action.${idsCL[Default]}" exit 1 fi @@ -47,7 +47,9 @@ case "$1" in fi echo -en "${ADISP}ing on Node ${nid} ($nip)...${idsCL[Default]}" $NCMD systemctl $3 $2 - if [[ $(${NCMD} pgrep ${2} | wc -l) -gt "0" ]]; then + if [[ "enable,disable" = *"${3}"* ]] || [ "${2}" = "daemon-reload" ]; then + echo -e "${idsCL[Green]}OK${idsCL[Default]}" + elif [[ $(${NCMD} pgrep ${2} | wc -l) -gt "0" ]]; then echo -e "${idsCL[Green]}OK${idsCL[Default]}" elif [ "$3" = "stop" ]; then echo -e "${idsCL[Red]}STOPPED${idsCL[Default]}" else echo -e "${idsCL[Red]}ERROR${idsCL[Default]}"