Hisoka-X commented on code in PR #3776:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3776#discussion_r1058039661


##########
seatunnel-core/seatunnel-starter/src/main/bin/stop-seatunnel-cluster.sh:
##########
@@ -0,0 +1,56 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+SHOW_USAGE="Usage: stop-seatunnel-cluster.sh [options]\n Options:\n       -cn, 
--cluster      The name of the cluster to shut down (default: 
seatunnel_default_cluster)\n        -h, --help          Show the usage message"
+APP_MAIN="org.apache.seatunnel.core.starter.seatunnel.SeaTunnelServer"
+
+if [ $# -ne 0 ]; then
+  while true; do
+    case "$1" in
+      -cn|--cluster)
+        shift
+        CLUSTER_NAME="$1"
+        break
+        ;;
+      -h|--help)
+        echo -e $SHOW_USAGE
+        exit 0
+        ;;
+      *)
+        echo "Unknown option: $1, please use [-h | --help] to show options"
+        exit 0
+        ;;
+    esac
+  done
+fi
+
+if test -z $CLUSTER_NAME;then
+   RES=$(ps -ef | grep $APP_MAIN | grep -v "\-cn\|\--cluster" | grep -v grep | 
awk '{print $2}')
+   if test -z $RES;then
+     echo "seatunnel_default_cluster is not running. Please check the correct 
name of the running cluster."

Review Comment:
   Hi Please make default cluster name be configurable. Because we will maybe 
change this value in the future.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to