bansho/container/configure.sh
aviau 2d614df79d Added arguments to configure-dashboard.sh
Change-Id: I73a896ea39ce562343c5c9469beb4190770d35c4
2015-06-17 11:13:38 -04:00

30 lines
875 B
Bash
Executable File

#!/bin/bash
CONFIG_FILE="/etc/apache2/sites-enabled/000-default.conf"
function configure_proxy {
echo "=> Configuring apache ProxyPass ..."
# Surveil URLS
sed -i "s|ProxyPass /surveil/ .*|ProxyPass /surveil/ ${BANSHO_SURVEIL_URL}|g" ${CONFIG_FILE}
sed -i "s|ProxyPassReverse /surveil/ .*|ProxyPassReverse /surveil/ ${BANSHO_SURVEIL_URL}|g" ${CONFIG_FILE}
# Bansho auth URL
sed -i "s|ProxyPass /surveil/v2/auth/.*|ProxyPass /surveil/v2/auth/ ${BANSHO_AUTH_URL}|g" ${CONFIG_FILE}
sed -i "s|ProxyPassReverse /surveil/v2/auth/.*|ProxyPass /surveil/v2/auth/ ${BANSHO_AUTH_URL}|g" ${CONFIG_FILE}
}
function configure_grafana {
/configure-dashboard.sh
}
configure_proxy
if [ -f "/.grafana_setup" ]; then
echo "=> Data sources had been created before, skipping ..."
else
(sleep 60 && configure_grafana && touch "/.grafana_setup")&
fi