diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 098b22dd..a17a80a7 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -67,14 +67,11 @@ MAIN_MENU() { case "$1" in service) if [ "$2" = "nginx" ]; then SER='NGINX' - elif [ "$2" = "haproxy" ]; then SER='HAProxy' - elif [ "$2" = "gogs" ]; then SER='Gogs' + 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 "" STA="$(tr '[:lower:]' '[:upper:]' <<< ${3:0:1})${3:1}" echo -e "${idsCL[LightGreen]}[[${SER} ${STA}ing]]${idsCL[Default]}" @@ -98,82 +95,12 @@ case "$1" in echo -e "${idsCL[Green]}OK${idsCL[Default]}" else echo -e "${idsCL[Red]}ERROR${idsCL[Default]}" fi + + echo "" echo -e "${idsCL[Green]}${SER} has been ${STA}ed${idsCL[Default]}" + echo "" exit 0 ;; - - haproxy-start) - sleep 15 - echo -e "${idsCL[LightBlue]}HAProxy Starting...${idsCL[Default]}" - ssh root@10.5.10.51 service haproxy start - ssh root@10.5.10.52 service haproxy start - ssh root@10.5.10.53 service haproxy start - exit 0;; - - haproxy-stop) - echo -e "${idsCL[LightBlue]}HAProxy Stopping...${idsCL[Default]}" - ssh root@10.5.10.51 service haproxy stop - ssh root@10.5.10.52 service haproxy stop - ssh root@10.5.10.53 service haproxy stop - exit 0;; - - haproxy-restart) - sleep 15 - echo -e "${idsCL[LightBlue]}HAProxy Starting...${idsCL[Default]}" - ssh root@10.5.10.51 service haproxy restart - ssh root@10.5.10.52 service haproxy restart - ssh root@10.5.10.53 service haproxy restart - exit 0;; - - gogs-start) - echo -e "${idsCL[LightBlue]}Gogs Starting...${idsCL[Default]}" - ssh root@10.5.10.51 service gogs start - ssh root@10.5.10.52 service gogs start - ssh root@10.5.10.53 service gogs start - exit 0;; - - gogs-stop) - echo -e "${idsCL[LightBlue]}Gogs Stopping...${idsCL[Default]}" - ssh root@10.5.10.51 service gogs stop - ssh root@10.5.10.52 service gogs stop - ssh root@10.5.10.53 service gogs stop - exit 0;; - - gogs-restart) - echo -e "${idsCL[LightBlue]}Gogs Restarting...${idsCL[Default]}" - ssh root@10.5.10.51 service gogs restart - ssh root@10.5.10.52 service gogs restart - ssh root@10.5.10.53 service gogs restart - exit 0;; - - nginx-start) - echo -e "${idsCL[LightBlue]}NGINX Starting...${idsCL[Default]}" - ssh root@10.5.10.51 service nginx start - ssh root@10.5.10.52 service nginx start - ssh root@10.5.10.53 service nginx start - exit 0;; - - nginx-stop) - echo -e "${idsCL[LightBlue]}NGINX Stopping...${idsCL[Default]}" - ssh root@10.5.10.51 service nginx stop - ssh root@10.5.10.52 service nginx stop - ssh root@10.5.10.53 service nginx stop - exit 0;; - - nginx-restart) - echo -e "${idsCL[LightBlue]}NGINX Restarting...${idsCL[Default]}" - ssh root@10.5.10.51 service nginx restart - ssh root@10.5.10.52 service nginx restart - ssh root@10.5.10.53 service nginx restart - exit 0;; - -nginx-reload) - echo -e "${idsCL[LightBlue]}NGINX Reloading...${idsCL[Default]}" - ssh root@10.5.10.51 service nginx reload - ssh root@10.5.10.52 service nginx reload - ssh root@10.5.10.53 service nginx reload - exit 0 - ;; newcert) "$0" haperoxy-stop