Update nodemgmt-scripts.sh
This commit is contained in:
@@ -14,7 +14,7 @@ source /opt/idssys/nodemgmt/defaults.inc
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
service)
|
service)
|
||||||
containsElement "${2}" "${NODE_SERVICES[@]}"
|
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]}"
|
echo -e "${idsCL[Red]}(${3}) is not an allowed service action.${idsCL[Default]}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -47,7 +47,9 @@ case "$1" in
|
|||||||
fi
|
fi
|
||||||
echo -en "${ADISP}ing on Node ${nid} ($nip)...${idsCL[Default]}"
|
echo -en "${ADISP}ing on Node ${nid} ($nip)...${idsCL[Default]}"
|
||||||
$NCMD systemctl $3 $2
|
$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]}"
|
echo -e "${idsCL[Green]}OK${idsCL[Default]}"
|
||||||
elif [ "$3" = "stop" ]; then echo -e "${idsCL[Red]}STOPPED${idsCL[Default]}"
|
elif [ "$3" = "stop" ]; then echo -e "${idsCL[Red]}STOPPED${idsCL[Default]}"
|
||||||
else echo -e "${idsCL[Red]}ERROR${idsCL[Default]}"
|
else echo -e "${idsCL[Red]}ERROR${idsCL[Default]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user