Skip to content

Commit 396ef33

Browse files
committed
Make sure we don't overwrite templates.
1 parent 268945d commit 396ef33

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/with-contenv sh
2+
# shellcheck shell=sh
23

34
set -e # Exit immediately if a command exits with a non-zero status.
45

@@ -26,4 +27,12 @@ fi
2627
#Make sure the config location is where we get the config from instead of /default/
2728
sed -i 's|/defaults/crowdsec|/config/crowdsec|' /config/crowdsec/crowdsec-openresty-bouncer.conf
2829
echo "Deploy Templates .."
29-
cp -r /defaults/crowdsec/templates/* /config/crowdsec/templates/
30+
31+
#Make sure we only copy files that don't exist in config.
32+
for file in /defaults/crowdsec/templates/*
33+
do
34+
if [ ! -e "/config/crowdsec/templates/${file}" ]
35+
then
36+
cp -r "/defaults/crowdsec/templates/${file}" "/config/crowdsec/templates/"
37+
fi
38+
done

0 commit comments

Comments
 (0)