aboutsummaryrefslogtreecommitdiffstats
path: root/docker/instance_config.sh
diff options
context:
space:
mode:
authoryangyan <yangyanyj@chinamobile.com>2019-04-02 17:29:13 +0800
committeryangyan <yangyanyj@chinamobile.com>2019-04-02 17:29:20 +0800
commit2cf221a285c4d44863198c44095a30036abe9e4f (patch)
treebe704fa28f90fd390d5f37356fb63fb312dcc212 /docker/instance_config.sh
parent83b6363bdca5d6fe7f270aa5387a1cdef71b099b (diff)
Fix docker init and config file
Change-Id: I1fd4e740f9d6fc84628837b7c16ba89c3e817553 Issue-ID: VFC-1332 Signed-off-by: yangyan <yangyanyj@chinamobile.com>
Diffstat (limited to 'docker/instance_config.sh')
-rwxr-xr-xdocker/instance_config.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/docker/instance_config.sh b/docker/instance_config.sh
index 185194cd..524d4e7f 100755
--- a/docker/instance_config.sh
+++ b/docker/instance_config.sh
@@ -29,14 +29,16 @@ fi
# Configure MYSQL
MYSQL_IP=`echo $MYSQL_ADDR | cut -d: -f 1`
MYSQL_PORT=`echo $MYSQL_ADDR | cut -d: -f 2`
-MYSQL_USER=`echo $MYSQL_AUTH | cut -d: -f 1`
-MYSQL_ROOT_PASSWORD=`echo $MYSQL_AUTH | cut -d: -f 2
-
echo "MYSQL_ADDR=$MYSQL_ADDR"
+
+if [ $REDIS_ADDR ]; then
+ REDIS_IP=`echo $REDIS_ADDR | cut -d: -f 1`
+else
+ REDIS_IP="$MYSQL_ADDR"
+fi
+
sed -i "s|DB_IP.*|DB_IP = '$MYSQL_IP'|" vfc/nfvo/lcm/lcm/pub/config/config.py
sed -i "s|DB_PORT.*|DB_PORT = $MYSQL_PORT|" vfc/nfvo/lcm/lcm/pub/config/config.py
sed -i "s|REDIS_HOST.*|REDIS_HOST = '$MYSQL_IP'|" vfc/nfvo/lcm/lcm/pub/config/config.py
-sed -i "s|DB_USER.*|DB_USER = '$MYSQL_USER'|" vfc/nfvo/lcm/lcm/pub/config/config.py
-sed -i "s|DB_PASSWD.*|DB_PASSWD = '$MYSQL_ROOT_PASSWORD'|" vfc/nfvo/lcm/lcm/pub/config/config.py
cat vfc/nfvo/lcm/lcm/pub/config/config.py