Fixing duplicate of lines in 01_caching_pool.conf

This commit is contained in:
Anton Reutov 2017-05-13 23:43:56 +02:00 committed by GitHub
parent c6694f2b41
commit 4c033a0a54

View file

@ -8,5 +8,12 @@ docroot=$5
str="proxy_cache_path /var/cache/nginx/$domain levels=2" str="proxy_cache_path /var/cache/nginx/$domain levels=2"
str="$str keys_zone=$domain:10m inactive=60m max_size=512m;" str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
echo "$str" >> /etc/nginx/conf.d/01_caching_pool.conf conf='/etc/nginx/conf.d/01_caching_pool.conf'
if [ -e "$conf" ]; then
if [ -z "$(grep "=${domain}:" $conf)" ]; then
echo "$str" >> $conf
fi
else
echo "$str" >> $conf
fi