changed the text to look for on success upload
[ccsdk/distribution.git] / odlsli / src / main / scripts / startODL.sh
1 #!/bin/bash
2
3 ###
4 # ============LICENSE_START=======================================================
5 # openECOMP : SDN-C
6 # ================================================================================
7 # Copyright (C) 2017 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
25 # Install SDN-C platform components if not already installed and start container
26
27 ODL_HOME=${ODL_HOME:-/opt/opendaylight/current}
28 ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U}
29 CCSDK_HOME=${CCSDK_HOME:-/opt/onap/ccsdk}
30 SLEEP_TIME=${SLEEP_TIME:-120}
31 MYSQL_PASSWD=${MYSQL_PASSWD:-openECOMP1.0}
32
33
34 #
35 # Wait for database
36 #
37 echo "Waiting for mysql"
38 until mysql -h dbhost -u root -p${MYSQL_PASSWD} mysql &> /dev/null
39 do
40   printf "."
41   sleep 1
42 done
43 echo -e "\nmysql ready"
44
45 if [ ! -f ${CCSDK_HOME}/.installed ]
46 then
47     echo "Installing SDN-C database"
48     ${CCSDK_HOME}/bin/installSdncDb.sh
49     echo "Starting OpenDaylight"
50     ${ODL_HOME}/bin/start
51     echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize"
52     sleep ${SLEEP_TIME}
53     echo "Installing SDN-C platform features"
54     ${CCSDK_HOME}/bin/installFeatures.sh
55     if [ -x ${CCSDK_HOME}/svclogic/bin/install.sh ]
56     then
57         echo "Installing directed graphs"
58         ${CCSDK_HOME}/svclogic/bin/install.sh
59     fi
60
61     echo "Restarting OpenDaylight"
62     ${ODL_HOME}/bin/stop
63     echo "Waiting 60 seconds for OpenDaylight stop to complete"
64     sleep 60
65     echo "Installed at `date`" > ${CCSDK_HOME}/.installed
66 fi
67
68 exec ${ODL_HOME}/bin/karaf

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use