#!/bin/sh

HOST="${DOMAIN}"
[ "${PORT}" != "443" ] && HOST="${PORT}:${DOMAIN}"
sed -i "s|\(^settings\.base\.public_url = \).*|\1\"https://sambro.${HOST}\"|" /srv/sambro/sahana_conf/000_config.py

sed -i "s|\(^settings\.mail\.sender = \).*|\1\"${EMAIL}\"|" /srv/sambro/sahana_conf/000_config.py
sed -i "s|\(^settings\.mail\.approver = \).*|\1\"${EMAIL}\"|" /srv/sambro/sahana_conf/000_config.py
sed -i "s|\(^settings\.gis\.api_google = \).*|\1\"${GMAPS_API_KEY}\"|" /srv/sambro/sahana_conf/000_config.py