Enhancements to reuse sliboot controller
[ccsdk/apps.git] / ms / sliboot / src / main / resources / startSliboot.sh
1 #!/bin/bash
2
3 ###
4 # ============LICENSE_START=======================================================
5 # ONAP : CCSDK
6 # ================================================================================
7 # Copyright (C) 2020 AT&T Intellectual Property. All rights
8 #                             reserved.
9 # ================================================================================
10 # Licensed under the Apache License, Version 2.0 (the "License");
11 # you may not use this file except in compliance with the License.
12 # You may obtain a copy of the License at
13 #
14 #      http://www.apache.org/licenses/LICENSE-2.0
15 #
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # See the License for the specific language governing permissions and
20 # limitations under the License.
21 # ============LICENSE_END=========================================================
22 ###
23
24 export CCSDK_HOME=${CCSDK_HOME:-/opt/onap/ccsdk}
25 export SLIBOOT_JAR=${SLIBOOT_JAR:-@ccsdk.sliboot.jar@}
26 export SVCLOGIC_DIR=${SVCLOGIC_DIR:-opt/onap/ccsdk/svclogic/graphs}
27 export LOG_PATH=${LOG_PATH:-/var/log/onap/ccsdk}
28 export CCSDK_CONFIG_DIR=${CCSDK_CONFIG_DIR:-/opt/onap/ccsdk/config}
29 export JAVA_SECURITY_DIR=${JAVA_SECURITY_DIR:-/etc/ssl/certs/java}
30 export MYSQL_DB_HOST=${MYSQL_DB_HOST:-dbhost}
31
32 #
33 # Wait for database
34 #
35 echo "Waiting for database"
36 until mysqladmin ping -h ${MYSQL_DB_HOST} --silent
37 do
38   printf "."
39   sleep 1
40 done
41 echo -e "\nDatabase ready"
42
43
44
45
46 echo -e "\nCerts ready"
47
48 cd $CCSDK_HOME
49 java -DserviceLogicDirectory=${SVCLOGIC_DIR} -DLOG_PATH=${LOG_PATH} -jar ${CCSDK_HOME}/lib/${SLIBOOT_JAR}
50