Fix a problem with the env var processing.

This commit is contained in:
Will Rouesnel 2016-04-04 13:49:54 +10:00
parent a33398b6d5
commit 811577a814
1 changed files with 4 additions and 2 deletions

View File

@ -51,14 +51,16 @@ if [ "$CONFIG_DISABLE" != "yes" ]; then
echo '# CACHE PEERS FROM DOCKER' >> /etc/squid4/squid.conf
env | grep 'CACHE_PEER' | sort | while read cacheline; do
echo "# $cacheline " >> /etc/squid4/squid.conf
echo "cache_peer ${!cacheline}" >> /etc/squid4/squid.conf
line=$(echo $cacheline | cut -d'=' -f2-)
echo "cache_peer $line" >> /etc/squid4/squid.conf
done
# Parse the extra config lines and append them to the configuration
echo '# EXTRA CONFIG FROM DOCKER' >> /etc/squid4/squid.conf
env | grep 'EXTRA_CONFIG' | sort | while read extraline; do
echo "# $extraline " >> /etc/squid4/squid.conf
echo "${!extraline}" >> /etc/squid4/squid.conf
line=$(echo $extraline | cut -d'=' -f2-)
echo "$line" >> /etc/squid4/squid.conf
done
else
echo "CONFIGURATION TEMPLATING IS DISABLED."