Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 1 | #!/bin/bash |
Jakub Latusek | 2eea149 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 2 | {{/* |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 3 | # |
| 4 | # ============LICENSE_START========================================== |
| 5 | # org.onap.music |
| 6 | # =================================================================== |
| 7 | # Copyright (c) 2019 AT&T Intellectual Property |
| 8 | # =================================================================== |
| 9 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | # you may not use this file except in compliance with the License. |
| 11 | # You may obtain a copy of the License at |
| 12 | # |
| 13 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | # |
| 15 | # Unless required by applicable law or agreed to in writing, software |
| 16 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | # See the License for the specific language governing permissions and |
| 19 | # limitations under the License. |
| 20 | # |
| 21 | # ============LICENSE_END============================================= |
| 22 | # ==================================================================== |
Jakub Latusek | 2eea149 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 23 | */}} |
Tschaen, Brendan | 08d7b63 | 2020-04-02 19:49:13 +0000 | [diff] [blame] | 24 | |
| 25 | echo "Running startup script to get password from certman" |
| 26 | PWFILE=/opt/app/aafcertman/.password |
| 27 | LOGFILE=/opt/app/music/logs/MUSIC/music-sb.log |
| 28 | PROPS=/opt/app/music/etc/music-sb.properties |
| 29 | LOGBACK=/opt/app/music/etc/logback.xml |
| 30 | LOGGING= |
| 31 | DEBUG_PROP= |
| 32 | # Debug Setup. Uses env variables |
| 33 | # DEBUG and DEBUG_PORT |
| 34 | # DEBUG=true/false | DEBUG_PORT=<Port valie must be integer> |
| 35 | if [ "${DEBUG}" == "true" ]; then |
| 36 | if [ "${DEBUG_PORT}" == "" ]; then |
| 37 | DEBUG_PORT=8000 |
| 38 | fi |
| 39 | echo "Debug mode on" |
| 40 | DEBUG_PROP="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=${DEBUG_PORT},suspend=n" |
| 41 | fi |
| 42 | |
| 43 | # LOGBACK file: if /opt/app/music/etc/logback.xml exists thenuse that. |
| 44 | if [ -f $LOGBACK ]; then |
| 45 | LOGGING="--logging.config=file:${LOGBACK}" |
| 46 | fi |
| 47 | |
| 48 | # Get Passwords from /opt/app/aafcertman |
| 49 | if [ -f $PWFILE ]; then |
| 50 | echo "Found ${PWFILE}" >> $LOGFILE |
| 51 | PASSWORD=$(cat ${PWFILE}) |
| 52 | else |
| 53 | PASSWORD=changeit |
| 54 | echo "#### Using Default Password for Certs" >> ${LOGFILE} |
| 55 | fi |
| 56 | |
| 57 | # If music-sb.properties exists in /opt/app/music/etc then use that to override the application.properties |
| 58 | if [ -f $PROPS ]; then |
| 59 | # Run with different Property file |
| 60 | #echo "java ${DEBUG_PROP} -jar MUSIC.jar --spring.config.location=file:${PROPS} ${LOGGING} 2>&1 | tee ${LOGFILE}" |
| 61 | java ${DEBUG_PROP} ${JAVA_OPTS} -jar MUSIC-SB.jar ${SPRING_OPTS} --spring.config.location=file:${PROPS} ${LOGGING} 2>&1 | tee ${LOGFILE} |
| 62 | else |
| 63 | #echo "java ${DEBUG_PROP} -jar MUSIC.jar --server.ssl.key-store-password=${PASSWORD} ${LOGGING} 2>&1 | tee ${LOGFILE}" |
| 64 | java ${DEBUG_PROP} ${JAVA_OPTS} -jar MUSIC-SB.jar ${SPRING_OPTS} --server.ssl.key-store-password="${PASSWORD}" ${LOGGING} 2>&1 | tee ${LOGFILE} |
| 65 | fi |
| 66 | |
| 67 | |
| 68 | |
| 69 | |