fix dmaap-listener startup and library
[sdnc/northbound.git] / dmaap-listener / src / main / scripts / stop-dmaap-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 LISTENER=dmaap-listener
27
28
29 PIDFILE=/tmp/.${LISTENER}-pid
30 UEBLISTENERROOT=${UEBLISTENERROOT:-/opt/app/dmaap-listener}
31
32 if [ -f $PIDFILE ]
33 then
34   pid=$(cat $PIDFILE)
35   if [ "$pid" != "" ]
36   then
37     if kill -0 $pid
38       then
39         echo "Stopping $LISTENER"
40         kill $pid && rm $PIDFILE
41         exit 0
42       else
43         echo "$LISTENER not running"
44         exit 1
45       fi
46   else
47       echo "$LISTENER not running"
48       exit 1
49   fi
50 fi
51
52