update link to upper-constraints.txt
[dmaap/datarouter.git] / datarouter-node / 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 'backup')
27     cp log4j.properties log4j.properties.save 2>/dev/null
28     cp node.properties node.properties.save 2>/dev/null
29     cp havecert havecert.save 2>/dev/null
30     ;;
31 'stop')
32     /opt/app/platform/init.d/drtrnode stop
33     ;;
34 'start')
35     /opt/app/platform/init.d/drtrnode start || exit 1
36     ;;
37 'config')
38     /bin/bash log4j.properties.tmpl >log4j.properties
39     /bin/bash node.properties.tmpl >node.properties
40     /bin/bash havecert.tmpl >havecert
41     echo "$AFTSWM_ACTION_NEW_VERSION" >VERSION.node
42     chmod +x havecert
43     rm -f /opt/app/platform/rc.d/K90drtrnode /opt/app/platform/rc.d/S10drtrnode
44     ln -s ../init.d/drtrnode /opt/app/platform/rc.d/K90drtrnode
45     ln -s ../init.d/drtrnode /opt/app/platform/rc.d/S10drtrnode
46     ;;
47 'restore')
48     cp log4j.properties.save log4j.properties 2>/dev/null
49     cp node.properties.save node.properties 2>/dev/null
50     cp havecert.save havecert 2>/dev/null
51     ;;
52 'clean')
53     rm -f log4j.properties node.properties havecert log4j.properties.save node.properties.save havecert.save SHUTDOWN redirections.dat VERSION.node
54     rm -f /opt/app/platform/rc.d/K90drtrnode /opt/app/platform/rc.d/S10drtrnode
55     ;;
56 *)
57     exit 1
58     ;;
59 esac
60 done
61 exit 0