Update 'nodemgmt-scripts.sh'

This commit is contained in:
2019-01-28 21:52:13 -06:00
parent 955b7cd99f
commit ec3e651c0d

View File

@@ -25,19 +25,23 @@ unset IFS
case "$1" in
service)
containsElement "${2}" "${NODE_SERVICES[@]}"
if [[ "start,stop,restart" != *"${3}"* ]]; then
if [[ "start,stop,restart,ebale,disable" != *"${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" = "gitea" ]; then SER='Gitea'
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" = "stop" ]; then ADISP='Stopp';
elif [ "$3" = "enable" ]; then ADISP='Enabl';
elif [ "$3" = "disable" ]; then ADISP='Disabl';
else ADISP="$(tr '[:lower:]' '[:upper:]' <<< ${3:0:1})${3:1}"; fi
if [ "$3" = "start" ] && [ "$2" = "haproxy" ]; then TACT='restart'; else TACT="${3}"; fi
echo -e "${idsCL[LightGreen]}[[${SER} ${ADISP}ing]]${idsCL[Default]}"