diff options
-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 |