Database reinitialization protection 67/46567/1
authoryangyan <yangyanyj@chinamobile.com>
Tue, 8 May 2018 09:28:49 +0000 (17:28 +0800)
committeryangyan <yangyanyj@chinamobile.com>
Tue, 8 May 2018 09:28:54 +0000 (17:28 +0800)
Issue-ID: VFC-900
Change-Id: I17b83165f2f497016bc46289c15f75554f9a0437
Signed-off-by: yangyan <yangyanyj@chinamobile.com>
docker/instance_init.sh

index 622477f..c240114 100755 (executable)
@@ -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
 }