4 # ============LICENSE_START==========================================
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
13 # http://www.apache.org/licenses/LICENSE-2.0
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.
21 # ============LICENSE_END=============================================
22 # ====================================================================
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
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
40 DEBUG_PROP="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=${DEBUG_PORT},suspend=n"
43 # LOGBACK file: if /opt/app/music/etc/logback.xml exists thenuse that.
44 if [ -f $LOGBACK ]; then
45 LOGGING="--logging.config=file:${LOGBACK}"
48 # Get Passwords from /opt/app/aafcertman
49 if [ -f $PWFILE ]; then
50 echo "Found ${PWFILE}" >> $LOGFILE
51 PASSWORD=$(cat ${PWFILE})
54 echo "#### Using Default Password for Certs" >> ${LOGFILE}
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}
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}