aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryangyan <yangyanyj@chinamobile.com>2018-05-08 17:28:49 +0800
committeryangyan <yangyanyj@chinamobile.com>2018-05-08 17:28:54 +0800
commit963b0928396d428eb3125a7f95b25e35fe7325b1 (patch)
tree61472440c1b4549e23a01170e145957bb9ce7993
parentb4bf83ebe222b304b2cd6afc52b020773a79899d (diff)
Database reinitialization protection
Issue-ID: VFC-900 Change-Id: I17b83165f2f497016bc46289c15f75554f9a0437 Signed-off-by: yangyan <yangyanyj@chinamobile.com>
-rwxr-xr-xdocker/instance_init.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/docker/instance_init.sh b/docker/instance_init.sh
index 622477fc..c2401144 100755
--- a/docker/instance_init.sh
+++ b/docker/instance_init.sh
@@ -16,7 +16,10 @@ function start_mysql {
function create_database {
cd /service/vfc/nfvo/catalog/resources/bin
- bash initDB.sh root $MYSQL_ROOT_PASSWORD 3306 127.0.0.1
+ if [ ! -f dbexist.txt ]; then
+ echo 1 > dbexist.txt
+ bash initDB.sh root $MYSQL_ROOT_PASSWORD 3306 127.0.0.1
+ fi
cd /service
}