#!/bin/bash -le

# Load environment variable options to overwrite in the config
export LAYER_BASE_DIR=${LAYER_BASE_DIR:-"/data/tiles"}

# Update the mapcache.xml file with the real host and port name
mf_tmpl="/work/abi_l1b_template.map"
export WMS_PLATFORMS=${WMS_PLATFORMS:-"g16 g17"}
export WMS_SECTORS=${WMS_SECTORS:-"radm1 radm2 radc radf"}
python3 /work/render.py $mf_tmpl "/work/mapfiles/{platform}_abi_{sector}_l1b.map"

/usr/sbin/apache2ctl configtest

/usr/sbin/apache2ctl -DFOREGROUND
