Skip to content

Commit 2304b93

Browse files
authored
Merge pull request hestiacp#2043 from erikdemarco/patch-1
Delete old configuration before changing to "caching" template
2 parents b136829 + ae03c67 commit 2304b93

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

install/deb/templates/web/nginx/caching.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ str="proxy_cache_path /var/cache/nginx/$domain levels=1:2"
1010
str="$str keys_zone=$domain:10m max_size=256m inactive=30m;"
1111
conf='/etc/nginx/conf.d/01_caching_pool.conf'
1212
if [ -e "$conf" ]; then
13-
if [ -z "$(grep "=${domain}:" $conf)" ]; then
14-
echo "$str" >> $conf
13+
if [ -n "$(grep "=${domain}:" $conf)" ]; then
14+
sed -i "/=${domain}:/d" $conf
1515
fi
16-
else
17-
echo "$str" >> $conf
1816
fi
19-
17+
echo "$str" >> $conf

0 commit comments

Comments
 (0)