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