Merge "fix maven local build issue"
[sdnc/northbound.git] / ueb-listener / src / main / scripts / stop-ueb-listener.sh
1 #!/bin/bash
2
3 ###
4 # ============LICENSE_START=======================================================
5 # openECOMP : SDN-C
6 # ================================================================================
7 # Copyright (C) 2017 AT&T Intellectual Property. All rights
8 #                                                       reserved.
9 # ================================================================================
10 # Licensed under the Apache License, Version 2.0 (the "License");
11 # you may not use this file except in compliance with the License.
12 # You may obtain a copy of the License at
13
14 #      http://www.apache.org/licenses/LICENSE-2.0
15
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # See the License for the specific language governing permissions and
20 # limitations under the License.
21 # ============LICENSE_END=========================================================
22 ###
23
24 PROPERTY_DIR=${PROPERTY_DIR:-/opt/sdnc/data/properties}
25
26 if [ -f ${PROPERTY_DIR}/dmaap-listener.properties ]
27 then
28         LISTENER=dmaap-listener
29 else
30         LISTENER=ueb-listener
31 fi
32
33 PIDFILE=/tmp/.${LISTENER}-pid
34 UEBLISTENERROOT=${UEBLISTENERROOT:-/opt/app/ueb-listener}
35
36 if [ -f $PIDFILE ]
37 then
38   pid=$(cat $PIDFILE)
39   if [ "$pid" != "" ]
40   then
41     if kill -0 $pid
42       then
43         echo "Stopping $LISTENER"
44         kill $pid && rm $PIDFILE
45         exit 0
46       else
47         echo "$LISTENER not running"
48         exit 1
49       fi
50   else
51       echo "$LISTENER not running"
52       exit 1
53   fi
54 fi
55
56