diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2019-04-02 16:48:53 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2019-04-02 16:48:53 +0800 |
commit | 379f5051b96162565f68d10c1f8fb38dc7f41aac (patch) | |
tree | 415dbd77b8e36fa7afdd1aa59f60992f15a90611 /mgr/docker/instance_config.sh | |
parent | 710cc80d5dd8cc200a69ba3c12826e0401d2a0ee (diff) |
Fix docker config file
Change-Id: I489c2237276fcf570041027f6fed6e7f418c2f54
Issue-ID: VFC-1306
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'mgr/docker/instance_config.sh')
-rwxr-xr-x | mgr/docker/instance_config.sh | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/mgr/docker/instance_config.sh b/mgr/docker/instance_config.sh index 7fe392b..02024d4 100755 --- a/mgr/docker/instance_config.sh +++ b/mgr/docker/instance_config.sh @@ -20,18 +20,14 @@ 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_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/vnfmgr/mgr/mgr/pub/config/config.py sed -i "s|DB_PORT.*|DB_PORT = $MYSQL_PORT|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py sed -i "s|REDIS_HOST.*|REDIS_HOST = '$REDIS_IP'|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py -sed -i "s|REDIS_PORT.*|REDIS_PORT = '$REDIS_PORT'|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py -sed -i "s|DB_USER.*|DB_USER = '$MYSQL_USER'|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py -sed -i "s|DB_PASSWD.*|DB_PASSWD = '$MYSQL_ROOT_PASSWORD'|" vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py - cat vfc/gvnfm/vnfmgr/mgr/mgr/pub/config/config.py |