6d5d93ffeba3a8e9eada03a7f76544a492a077ff
[vfc/nfvo/wfengine.git] / wso2bpel-ext / wso2bpel-core / distribution / standalone / src / main / assembly / stop.sh
1 #
2 # Copyright 2016 ZTE Corporation.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 #!/bin/bash
18 #
19 #
20 # Copyright 2016 [ZTE] and others.
21 #
22 # Licensed under the Apache License, Version 2.0 (the "License");
23 # you may not use this file except in compliance with the License.
24 # You may obtain a copy of the License at
25 #
26 #     http://www.apache.org/licenses/LICENSE-2.0
27 #
28 # Unless required by applicable law or agreed to in writing, software
29 # distributed under the License is distributed on an "AS IS" BASIS,
30 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 # See the License for the specific language governing permissions and
32 # limitations under the License.
33 #
34
35 DIRNAME=`dirname $0`
36 HOME=`cd $DIRNAME/; pwd`
37 Main_Class="org.openo.carbon.bpel.Wso2BpelApplication"
38
39 echo ================== wso2bpel-service info =============================================
40 echo HOME=$HOME
41 echo Main_Class=$Main_Class
42 echo ===============================================================================
43 cd $HOME; pwd
44
45 echo @WORK_DIR@ $HOME
46
47 function save_service_pid(){
48     service_pid=`ps -ef | grep $Main_Class | grep -v grep | awk '{print $2}'`
49     echo @service_pid@ $service_pid
50 }
51
52 function kill_service_process(){
53     ps -p $service_pid
54     if [ $? == 0 ]; then
55         kill -9 $service_pid
56     fi
57 }
58
59 save_service_pid;
60 echo @C_CMD@ kill -9 $service_pid
61 kill_service_process;