Update nodemgmt-scripts.sh

This commit is contained in:
2019-01-29 12:00:44 -06:00
parent 025f5c5cca
commit 9f70e61abc

View File

@@ -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]}"