|
@@ -10,10 +10,8 @@ str="proxy_cache_path /var/cache/nginx/$domain levels=1:2"
|
|
|
str="$str keys_zone=$domain:10m max_size=256m inactive=30m;"
|
|
str="$str keys_zone=$domain:10m max_size=256m inactive=30m;"
|
|
|
conf='/etc/nginx/conf.d/01_caching_pool.conf'
|
|
conf='/etc/nginx/conf.d/01_caching_pool.conf'
|
|
|
if [ -e "$conf" ]; then
|
|
if [ -e "$conf" ]; then
|
|
|
- if [ -z "$(grep "=${domain}:" $conf)" ]; then
|
|
|
|
|
- echo "$str" >> $conf
|
|
|
|
|
|
|
+ if [ -n "$(grep "=${domain}:" $conf)" ]; then
|
|
|
|
|
+ sed -i "/=${domain}:/d" $conf
|
|
|
fi
|
|
fi
|
|
|
-else
|
|
|
|
|
- echo "$str" >> $conf
|
|
|
|
|
fi
|
|
fi
|
|
|
-
|
|
|
|
|
|
|
+echo "$str" >> $conf
|