Add support for sorted CACHE_PEER env vars

This commit is contained in:
Will Rouesnel 2016-03-29 13:31:12 +11:00
parent 3aa9af014d
commit f1774f007d
1 changed files with 8 additions and 0 deletions

View File

@ -45,5 +45,13 @@ chown -R proxy: /var/lib/ssl_db
# Set the configuration
p2 -t /squid.conf.p2 > /etc/squid4/squid.conf
# Parse the cache peer lines from the environment and add them to the
# configuration
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
done
squid -z -N
squid -N