Skip to content

Commit 835343c

Browse files
authored
Fixing duplicate of lines in 01_caching_pool.conf
1 parent 2bff53e commit 835343c

File tree

1 file changed

+10
-4
lines changed
  • install/ubuntu/16.04/templates/web/nginx

1 file changed

+10
-4
lines changed

install/ubuntu/16.04/templates/web/nginx/caching.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ ip=$3
66
home=$4
77
docroot=$5
88

9-
str="proxy_cache_path /var/cache/nginx/$domain levels=2"
10-
str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
11-
echo "$str" >> /etc/nginx/conf.d/01_caching_pool.conf
12-
9+
str="proxy_cache_path /var/cache/nginx/$domain levels=2"
10+
str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
11+
conf='/etc/nginx/conf.d/01_caching_pool.conf'
12+
if [ -e "$conf" ]; then
13+
if [ -z "$(grep "=${domain}:" $conf)" ]; then
14+
echo "$str" >> $conf
15+
fi
16+
else
17+
echo "$str" >> $conf
18+
fi

0 commit comments

Comments
 (0)