diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2019-04-02 16:45:23 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2019-04-02 16:45:23 +0800 |
commit | 32a70355a0fa097e320ee8f747e41f5f87204937 (patch) | |
tree | 1b2b4a88208c019c39ce311354ab17ff4a533e62 /res/docker/instance_config.sh | |
parent | 028b3145d19b9eefddd02714f112ff31fcb14d6d (diff) |
Fix docker config file
Change-Id: Ib469a1c5e88585a54e15c3ef7bf49fdb90e67ed0
Issue-ID: VFC-1306
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'res/docker/instance_config.sh')
-rwxr-xr-x | res/docker/instance_config.sh | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/res/docker/instance_config.sh b/res/docker/instance_config.sh index f47b54f..5ad6b9f 100755 --- a/res/docker/instance_config.sh +++ b/res/docker/instance_config.sh @@ -20,19 +20,15 @@ MYSQL_IP=`echo $MYSQL_ADDR | cut -d: -f 1` MYSQL_PORT=`echo $MYSQL_ADDR | cut -d: -f 2` echo "MYSQL_ADDR=$MYSQL_ADDR" -MYSQL_USER=`echo $MYSQL_AUTH | cut -d: -f 1` -MYSQL_ROOT_PASSWORD=`echo $MYSQL_AUTH | cut -d: -f 2` -#redis -REDIS_IP=`echo $REDIS_ADDR | cut -d: -f 1` -REDIS_PORT=`echo $REDIS_ADDR | cut -d: -f 2` +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/gvnfm/vnfres/res/res/pub/config/config.py sed -i "s|DB_PORT.*|DB_PORT = $MYSQL_PORT|" vfc/gvnfm/vnfres/res/res/pub/config/config.py #redis sed -i "s|REDIS_HOST.*|REDIS_HOST = '$REDIS_IP'|" vfc/gvnfm/vnfres/res/res/pub/config/config.py -sed -i "s|REDIS_PORT.*|REDIS_PORT = '$REDIS_PORT'|" vfc/gvnfm/vnfres/res/res/pub/config/config.py - -sed -i "s|DB_USER.*|DB_USER = '$MYSQL_USER'|" vfc/gvnfm/vnfres/res/res/pub/config/config.py -sed -i "s|DB_PASSWD.*|DB_PASSWD = '$MYSQL_ROOT_PASSWORD'|" vfc/gvnfm/vnfres/res/res/pub/config/config.py cat vfc/gvnfm/vnfres/res/res/pub/config/config.py |