From 969b231941df18979ff6c0cb317b34934024b307 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 27 Jan 2019 20:06:27 -0600 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 499488b9..0c4c6331 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -70,19 +70,20 @@ case "$1" in elif [ "$2" = "haproxy" ]; then SER='HAProxy' elif [ "$2" = "gogs" ]; then SER='Gogs' fi - if [ "$3" = "start" ]; then STA='Starting'; $STAP='Started' - elif [ "$3" = "stop" ]; then STA='Stopping'; $STAP='Stopped' - elif [ "$3" = "restart" ]; then STA='Restarting'; $STAP='Restarted' - elif [ "$3" = "reload" ]; then STA='Reloading'; $STAP='Reloaded' - fi - echo -e "${idsCL[LightBlue]}[[${SER} ${STA}]]${idsCL[Default]}" - echo -e "${idsCL[Cyan]}${STA} Node 1...${idsCL[Default]}" + #if [ "$3" = "start" ]; then STA='Starting'; $STAP='Started' + #elif [ "$3" = "stop" ]; then STA='Stopping'; $STAP='Stopped' + #elif [ "$3" = "restart" ]; then STA='Restarting'; $STAP='Restarted' + #elif [ "$3" = "reload" ]; then STA='Reloading'; $STAP='Reloaded' + #fi + STA="$(tr '[:lower:]' '[:upper:]' <<< ${3:0:1})${3:1}" + echo -e "${idsCL[LightBlue]}[[${SER} ${STA}ing]]${idsCL[Default]}" + echo -e "${idsCL[Cyan]}${STA}ing Node 1...${idsCL[Default]}" ssh root@10.5.10.51 systemctl $3 $2 - echo -e "${idsCL[Cyan]}${STA} Node 2...${idsCL[Default]}" + echo -e "${idsCL[Cyan]}${STA}ing Node 2...${idsCL[Default]}" ssh root@10.5.10.52 systemctl $3 $2 - echo -e "${idsCL[Cyan]}${STA} Node 3...${idsCL[Default]}" + echo -e "${idsCL[Cyan]}${STA}ing Node 3...${idsCL[Default]}" ssh root@10.5.10.53 systemctl $3 $2 - echo -e "${idsCL[Green]}${SER} has been ${STAP}${idsCL[Default]}" + echo -e "${idsCL[Green]}${SER} has been ${STA}ed${idsCL[Default]}" exit 0 ;;