sg481n | aaf2df8 | 2017-08-03 17:56:38 -0400 | [diff] [blame] | 1 | #!/bin/bash |
Fiachra Corcoran | fa1da98 | 2018-07-26 07:23:34 +0100 | [diff] [blame] | 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. |
sg481n | aaf2df8 | 2017-08-03 17:56:38 -0400 | [diff] [blame] | 21 | |
| 22 | cd /opt/app/datartr/etc |
| 23 | for action in "$@" |
| 24 | do |
| 25 | case "$action" in |
| 26 | 'backup') |
eronkeo | 1841cb5 | 2018-08-12 15:46:43 +0100 | [diff] [blame] | 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 | ;; |
sg481n | aaf2df8 | 2017-08-03 17:56:38 -0400 | [diff] [blame] | 31 | 'stop') |
eronkeo | 1841cb5 | 2018-08-12 15:46:43 +0100 | [diff] [blame] | 32 | /opt/app/platform/init.d/drtrnode stop |
| 33 | ;; |
sg481n | aaf2df8 | 2017-08-03 17:56:38 -0400 | [diff] [blame] | 34 | 'start') |
eronkeo | 1841cb5 | 2018-08-12 15:46:43 +0100 | [diff] [blame] | 35 | /opt/app/platform/init.d/drtrnode start || exit 1 |
| 36 | ;; |
sg481n | aaf2df8 | 2017-08-03 17:56:38 -0400 | [diff] [blame] | 37 | 'config') |
eronkeo | 1841cb5 | 2018-08-12 15:46:43 +0100 | [diff] [blame] | 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 | ;; |
sg481n | aaf2df8 | 2017-08-03 17:56:38 -0400 | [diff] [blame] | 47 | 'restore') |
eronkeo | 1841cb5 | 2018-08-12 15:46:43 +0100 | [diff] [blame] | 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 | ;; |
sg481n | aaf2df8 | 2017-08-03 17:56:38 -0400 | [diff] [blame] | 52 | 'clean') |
eronkeo | 1841cb5 | 2018-08-12 15:46:43 +0100 | [diff] [blame] | 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 | ;; |
sg481n | aaf2df8 | 2017-08-03 17:56:38 -0400 | [diff] [blame] | 56 | *) |
eronkeo | 1841cb5 | 2018-08-12 15:46:43 +0100 | [diff] [blame] | 57 | exit 1 |
| 58 | ;; |
sg481n | aaf2df8 | 2017-08-03 17:56:38 -0400 | [diff] [blame] | 59 | esac |
| 60 | done |
| 61 | exit 0 |