Modify package structure and pom file
[vfc/nfvo/driver/ems.git] / ems / microservice-standalone / src / main / assembly / stop.sh
1 #!/bin/bash\r
2 #\r
3 # Copyright (C) 2015 CMCC, Inc. and others. All rights reserved. (CMCC)\r
4 #\r
5 # Licensed under the Apache License, Version 2.0 (the "License");\r
6 # you may not use this file except in compliance with the License.\r
7 # You may obtain a copy of the License at\r
8 #\r
9 #         http://www.apache.org/licenses/LICENSE-2.0\r
10 #\r
11 # Unless required by applicable law or agreed to in writing, software\r
12 # distributed under the License is distributed on an "AS IS" BASIS,\r
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14 # See the License for the specific language governing permissions and\r
15 # limitations under the License.\r
16 #\r
17 \r
18 DIRNAME=`dirname $0`\r
19 HOME=`cd $DIRNAME/; pwd`\r
20 Main_Class="org.onap.vfc.nfvo.emsdriver.EMSDriverApp"\r
21 \r
22 echo ================== umc-service info  =============================================\r
23 echo HOME=$HOME\r
24 echo Main_Class=$Main_Class\r
25 echo ===============================================================================\r
26 cd $HOME; pwd\r
27 \r
28 echo @WORK_DIR@ $HOME\r
29 \r
30 save_service_pid(){\r
31         service_pid=`ps -ef | grep $Main_Class | grep -v grep | awk '{print $2}'`\r
32         echo @service_pid@ $service_pid\r
33 }\r
34 \r
35 kill_service_process(){\r
36         ps -p $service_pid\r
37         if [ $? -eq 0 ]; then\r
38                 kill -9 $service_pid\r
39         fi\r
40 }\r
41 \r
42 save_service_pid;\r
43 echo @C_CMD@ kill -9 $service_pid\r
44 kill_service_process;\r