diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2018-08-04 11:16:29 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2018-08-04 11:21:29 +0800 |
commit | f5e35d09ff5dda2899f52c00c06da7e7e72a2c64 (patch) | |
tree | 9b8fea0c9b21c315f35cf28b9e36de0d3ae267df /docker/instance_run.sh | |
parent | e6bbd47fea516548bcfa3213da7aa060138fde33 (diff) |
Add vfc-db component seed codes
Change-Id: If1634e4124a71ef0544caef9aee1a08da060a803
Issue-ID: VFC-954
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'docker/instance_run.sh')
-rwxr-xr-x | docker/instance_run.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/docker/instance_run.sh b/docker/instance_run.sh new file mode 100755 index 0000000..3e459ad --- /dev/null +++ b/docker/instance_run.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +function start_redis_server { + redis-server & +} + +function start_mysql { + service mysql start + sleep 1 +} + +function create_database { + cd /service/vfc/nfvo/db/resources + for ms in $(ls) + do + cd $ms/bin + bash initDB.sh root $MYSQL_ROOT_PASSWORD 3306 127.0.0.1 + cd /service/vfc/nfvo/db/resources + done + cd /service +} + +function run_forever { + while [ ! -f /var/log/mysql.log ]; do + sleep 1 + done + tail -F /var/log/mysql.log +} + +start_redis_server +start_mysql +if [ ! -f dbexist.txt ]; then + echo 1 > dbexist.txt + create_database +fi +run_forever |