6153683261aa0911fcfe772059f10c424c0d6d23
[music.git] / distribution / music / startup.sh
1 #!/bin/bash
2 #
3 # ============LICENSE_START==========================================
4 # org.onap.music
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
11
12 #     http://www.apache.org/licenses/LICENSE-2.0
13
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.
19
20 # ============LICENSE_END=============================================
21 # ====================================================================
22
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 echo "PWFILE=${PWFILE}" >> $LOGFILE
27 if [ -f $PWFILE ]; then
28 echo "Found ${PWFILE}" >> $LOGFILE
29 PASSWORD=$(cat ${PWFILE})
30 echo "#### Using Password from ${PWFILE} for Certs" >> ${LOGFILE}
31 else
32 PASSWORD=changeit
33 echo "#### Using Default Password for Certs" >> ${LOGFILE}
34 fi
35 if [ ${EXTAP} ]; then
36     if [ "${EXTAP_FILE}" != "" ]; then
37         EXTAP_OPTION="--spring.config.location=file:${EXTAP_FILE}"
38     fi
39 fi
40 echo "java -jar MUSIC-SB.jar ${EXTAP_OPTION} --server.ssl.key-store-password=${PASSWORD} --aaf_password=enc:${PASSWORD} 2>&1 | tee ${LOGFILE}"
41 java -jar MUSIC-SB.jar ${EXTAP_OPTION} --server.ssl.key-store-password="${PASSWORD}" --aaf_password="enc:${PASSWORD}" 2>&1 | tee ${LOGFILE}
42