Database reinitialization protection 57/46557/1 2.0.0-ONAP beijing 2.0.0-ONAP v1.1.0
authoryangyan <yangyanyj@chinamobile.com>
Tue, 8 May 2018 09:17:37 +0000 (17:17 +0800)
committeryangyan <yangyanyj@chinamobile.com>
Tue, 8 May 2018 09:17:42 +0000 (17:17 +0800)
Issue-ID: VFC-900
Change-Id: I84c8f152325b0f1fd65b92772309cb9a6f97b771
Signed-off-by: yangyan <yangyanyj@chinamobile.com>
lcm/docker/instance_init.sh

index 90468f8..2764a07 100755 (executable)
@@ -11,7 +11,10 @@ function start_mysql {
 
 function create_database {
     cd /service/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
 }