Files missing License text
[dmaap/buscontroller.git] / misc / doaction
1 #!/bin/bash
2 #
3 # ============LICENSE_START==========================================
4 # org.onap.dmaap
5 # ===================================================================
6 # Copyright © 2018 AT&T Intellectual Property. All rights reserved.
7 # ===================================================================
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 #
12 #        http://www.apache.org/licenses/LICENSE-2.0
13 #
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 # ============LICENSE_END============================================
20 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
21 #
22 #
23
24 cd /opt/app/dmaapbc/etc
25 for action in "$@"
26 do
27 case "$action" in
28 'backup')
29         cp log4j.properties log4j.properties.save 2>/dev/null
30         cp dmaapbc.properties dmaapbc.properties.save 2>/dev/null
31         cp havecert havecert.save 2>/dev/null
32         ;;
33 'stop')
34         /opt/app/platform/init.d/dmaapbc stop
35         ;;
36 'start')
37         /opt/app/platform/init.d/dmaapbc start || exit 1
38         ;;
39 'config')
40         /bin/bash log4j.properties.tmpl >log4j.properties
41         /bin/bash dmaapbc.properties.tmpl >dmaapbc.properties
42         /bin/bash havecert.tmpl >havecert
43         /bin/bash PolicyEngineApi.properties.tmpl > ../config/PolicyEngineApi.properties
44         chmod +x havecert
45         rm -f /opt/app/platform/rc.d/K90dmaapbc /opt/app/platform/rc.d/S10dmaapbc
46         ln -s ../init.d/dmaapbc /opt/app/platform/rc.d/K90dmaapbc
47         ln -s ../init.d/dmaapbc /opt/app/platform/rc.d/S10dmaapbc
48         ;;
49 'restore')
50         cp log4j.properties.save log4j.properties 2>/dev/null
51         cp dmaapbc.properties.save dmaapbc.properties 2>/dev/null
52         cp havecert.save havecert 2>/dev/null
53         ;;
54 'clean')
55         rm -f log4j.properties dmaapbc.properties havecert log4j.properties.save dmaapbc.properties.save havecert.save SHUTDOWN redirections.dat VERSION.dmaapbc
56         rm -f /opt/app/platform/rc.d/K90dmaapbc /opt/app/platform/rc.d/S10dmaapbc
57         ;;
58 *)
59         exit 1
60         ;;
61 esac
62 done
63 exit 0