blob: d3dd9b86caae2a904555b5dea02778af9d5bbd88 [file] [log] [blame]
ATT default cloud user17b1b972017-08-31 21:34:47 +00001#!/bin/bash
2
3cd /opt/app/dmaapbc/etc
4for action in "$@"
5do
6case "$action" in
7'backup')
8 cp log4j.properties log4j.properties.save 2>/dev/null
9 cp dmaapbc.properties dmaapbc.properties.save 2>/dev/null
10 cp havecert havecert.save 2>/dev/null
11 ;;
12'stop')
13 /opt/app/platform/init.d/dmaapbc stop
14 ;;
15'start')
16 /opt/app/platform/init.d/dmaapbc start || exit 1
17 ;;
18'config')
19 /bin/bash log4j.properties.tmpl >log4j.properties
20 /bin/bash dmaapbc.properties.tmpl >dmaapbc.properties
21 /bin/bash havecert.tmpl >havecert
22 /bin/bash PolicyEngineApi.properties.tmpl > ../config/PolicyEngineApi.properties
23 echo "$AFTSWM_ACTION_NEW_VERSION" >VERSION.dmaapbc
24 chmod +x havecert
25 rm -f /opt/app/platform/rc.d/K90dmaapbc /opt/app/platform/rc.d/S10dmaapbc
26 ln -s ../init.d/dmaapbc /opt/app/platform/rc.d/K90dmaapbc
27 ln -s ../init.d/dmaapbc /opt/app/platform/rc.d/S10dmaapbc
28 ;;
29'restore')
30 cp log4j.properties.save log4j.properties 2>/dev/null
31 cp dmaapbc.properties.save dmaapbc.properties 2>/dev/null
32 cp havecert.save havecert 2>/dev/null
33 ;;
34'clean')
35 rm -f log4j.properties dmaapbc.properties havecert log4j.properties.save dmaapbc.properties.save havecert.save SHUTDOWN redirections.dat VERSION.dmaapbc
36 rm -f /opt/app/platform/rc.d/K90dmaapbc /opt/app/platform/rc.d/S10dmaapbc
37 ;;
38*)
39 exit 1
40 ;;
41esac
42done
43exit 0