Skip to content

Commit 1272384

Browse files
committed
Make sure we only copy template files that are not installed already.
1 parent 2287f76 commit 1272384

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docker/rootfs/etc/cont-init.d/99_crowdsec-openresty-bouncer.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,12 @@ else
2121
fi
2222
#Make sure the config location is where we get the config from instead of /default/
2323
sed -i 's|/defaults/crowdsec|/data/crowdsec|' /data/crowdsec/crowdsec-openresty-bouncer.conf
24-
echo "Deploy Templates .."
25-
cp -r /defaults/crowdsec/templates/* /data/crowdsec/templates/
24+
echo "Deploy Templates .."
25+
#Make sure we only copy files that don't exist in /data/crowdsec.
26+
for file in /defaults/crowdsec/templates/*
27+
do
28+
if [ ! -e "/data/crowdsec/templates/${file}" ]
29+
then
30+
cp -r "/defaults/crowdsec/templates/${file}" "/data/crowdsec/templates/"
31+
fi
32+
done

0 commit comments

Comments
 (0)