diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 7fadf9e1..e069f529 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -13,7 +13,10 @@ source /opt/idssys/nodemgmt/defaults.inc case "$1" in service) - containsElement "${2}" "${NODE_SERVICES[@]}" + if [ ! containsElement "${2}" "${NODE_SERVICES[@]}" ] && [ ! containsElement "${2}" "${LOCAL_SERVICES[@]}" ]; then + echo -e "${idsCL[Red]}(${2}) is not an allowed service.${idsCL[Default]}" + exit 1 + fi 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 diff --git a/run.sh b/run.sh index 114d1fed..70a76893 100755 --- a/run.sh +++ b/run.sh @@ -13,7 +13,10 @@ if [ "$1" != "service" ] && [ "$1" != "status-check" ]; then echo -e "${idsCL[Yellow]} NodeMgmt - Galera/NGINX Node Management${idsCL[Default]} ${idsCL[DarkGray]}(ver-${VERS})${idsCL[Default]}" echo -e "${idsCL[Yellow]}-------------------------------------------------------------${idsCL[Default]}" echo -e "Node hostname: ${idsST[Bold]}${idsCL[LightCyan]}${NODE_HOSTNAME}${idsCL[Default]}${idsST[Reset]}" - for srvc in "${NODE_SERVICES[@]}" + if [ "${LOCAL_SERVICES}" != "" ]; then SERVICES=${LOCAL_SERVICES} + else SERVICES=${NODE_SERVICES} + fi + for srvc in "${SERVICES[@]}" do if [ "${NM_SERVICES[${srvc}]}" = "" ]; then NM_SERVICES[${srvc}]="${srvc}"; fi echo -en "${NM_SERVICES[${srvc}]} " @@ -48,7 +51,6 @@ if [ "$1" != "service" ] && [ "$1" != "status-check" ]; then fi echo -en "\e[1A"; echo -e "\e[0K\r ${idsCL[Green]}Updates Completed${idsCL[Default]}" - echo "" fi fi /opt/idssys/nodemgmt/nodemgmt-scripts.sh $1 $2 $3 $4