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