I've created a bash script that gets an IP Address as variable `${MYSQL_SERVER_IP}`. I then want to pass it in a sed to replace the previous IP address in a settings.py file. Here is the closest I have gotten to a sed statement that actually runs without error: 

```
export MYSQL_SERVER_IP= '172.19.0.2'
sed -i -e '/DB_HOST =/c\DB_HOST = os.getenv( '\''IP'\'', '\''${MYSQL_SERVER_IP}'\'')\' Flask-URL-Shortener/settings.py

```

The problem is that the script doesn't replace the variable with the value of the variable.

In the file before running the script:

```
DB_HOST = os.getenv( 'IP', '172.31.0.2')

```

Currently the output I get is wrong:

```
DB_HOST = os.getenv( 'IP', '${MYSQL_SERVER_IP}')

```

as I would like to obtain the following output:

```
DB_HOST = os.getenv( 'IP', '172.19.0.2')

```

This sed statement is the last line of code I need to fix to make my program work the way I want it to.