blob: e3cee36f1fd7096fef4d65245966203e86b95257 [file] [log] [blame]
Tschaen, Brendan08d7b632020-04-02 19:49:13 +00001#!/bin/bash
Jakub Latusek2eea1492020-10-21 13:36:29 +02002{{/*
Tschaen, Brendan08d7b632020-04-02 19:49:13 +00003#
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 Latusek2eea1492020-10-21 13:36:29 +020023*/}}
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000024
25echo "Running startup script to get password from certman"
26PWFILE=/opt/app/aafcertman/.password
27LOGFILE=/opt/app/music/logs/MUSIC/music-sb.log
28PROPS=/opt/app/music/etc/music-sb.properties
29LOGBACK=/opt/app/music/etc/logback.xml
30LOGGING=
31DEBUG_PROP=
32# Debug Setup. Uses env variables
33# DEBUG and DEBUG_PORT
34# DEBUG=true/false | DEBUG_PORT=<Port valie must be integer>
Guillaume Lambert5f4af052021-03-09 21:52:32 +010035if [ "${DEBUG}" = "true" ]; then
36 if [ "${DEBUG_PORT}" = "" ]; then
Tschaen, Brendan08d7b632020-04-02 19:49:13 +000037 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"
41fi
42
43# LOGBACK file: if /opt/app/music/etc/logback.xml exists thenuse that.
44if [ -f $LOGBACK ]; then
45 LOGGING="--logging.config=file:${LOGBACK}"
46fi
47
48# Get Passwords from /opt/app/aafcertman
49if [ -f $PWFILE ]; then
50 echo "Found ${PWFILE}" >> $LOGFILE
51 PASSWORD=$(cat ${PWFILE})
52else
53 PASSWORD=changeit
54 echo "#### Using Default Password for Certs" >> ${LOGFILE}
55fi
56
57# If music-sb.properties exists in /opt/app/music/etc then use that to override the application.properties
58if [ -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}
62else
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}
65fi
66
67
68
69