Merge "Fix docker ENTRYPOINT script"
[vfc/nfvo/lcm.git] / docker / instance_init.sh
1 #!/bin/bash
2
3 function install_python_libs {
4     cd /service/vfc/nfvo/lcm/
5     pip install -r requirements.txt
6 }
7
8 function start_redis_server {
9     redis-server &
10 }
11
12 function start_mysql {
13     sed -i "s|bind-address.*|# bind-address = 127.0.0.1|" /etc/mysql/my.cnf
14     service mysql restart
15     sleep 1
16 }
17
18 function create_database {
19     cd /service/vfc/nfvo/lcm/resources/bin
20     bash initDB.sh root $MYSQL_ROOT_PASSWORD 3306 127.0.0.1
21     cd /service
22 }
23
24 install_python_libs
25 start_redis_server
26 start_mysql
27 create_database