Update nodemgmt-scripts.sh

This commit is contained in:
2019-01-28 15:53:50 -06:00
parent 4a9a935140
commit f8ccdedd9b

View File

@@ -23,12 +23,18 @@ unset IFS
case "$1" in
service)
containsElement "${2}" "${NODE_SERVICES[@]}"
if [[ "start,stop,restart" == *"${3}"* ]]; then
echo -e "${idsCL[Red]}(${3}) is not an allowed service action.${idsCL[Default]}"
exit 1
fi
if [ "$2" = "mysql" ]; then SER='MySQL'
elif [ "$2" = "nginx" ]; then SER='NGINX'
elif [ "$2" = "gogs" ]; then SER='Gogs'
elif [ "$2" = "haproxy" ]; then SER='HAProxy'
elif [ "$2" = "keepalived" ]; then SER='Keepalived'
elif [ "$2" = "maxscale" ]; then SER='MaxScale'
else SER="${2}"
fi
if [ "$3" = "stop" ]; then ADISP='Stopp'; else ADISP="$(tr '[:lower:]' '[:upper:]' <<< ${3:0:1})${3:1}"; fi
if [ "$3" = "start" ] && [ "$2" = "haproxy" ]; then TACT='restart'; else TACT="${3}"; fi