From e1698a903cca00d1bdc786d0af27987c4db7e7b4 Mon Sep 17 00:00:00 2001 From: LePresidente Date: Fri, 10 May 2024 09:07:52 +0200 Subject: [PATCH] Don't try copy templates if we are using environment variables for the configuration. --- .../s6-rc.d/cs-crowdsec-bouncer/script.sh | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/docker/rootfs/etc/s6-overlay/s6-rc.d/cs-crowdsec-bouncer/script.sh b/docker/rootfs/etc/s6-overlay/s6-rc.d/cs-crowdsec-bouncer/script.sh index da5e9000..06563810 100755 --- a/docker/rootfs/etc/s6-overlay/s6-rc.d/cs-crowdsec-bouncer/script.sh +++ b/docker/rootfs/etc/s6-overlay/s6-rc.d/cs-crowdsec-bouncer/script.sh @@ -39,13 +39,16 @@ else sed -i 's|/defaults/crowdsec|/data/crowdsec|' /data/crowdsec/crowdsec-openresty-bouncer.conf fi -echo "Deploy Crowdsec Templates .." + #Make sure we only copy files that don't exist in /data/crowdsec. -cd /defaults/crowdsec/templates/ -for file in *.html -do - if [ ! -e "/data/crowdsec/templates/${file}" ] - then - cp -r "/defaults/crowdsec/templates/${file}" "/data/crowdsec/templates/" - fi -done \ No newline at end of file +if [ -d "/data/crowdsec/templates" ]; then + echo "Deploy Crowdsec Templates .." + cd /defaults/crowdsec/templates/ + for file in *.html + do + if [ ! -e "/data/crowdsec/templates/${file}" ] + then + cp -r "/defaults/crowdsec/templates/${file}" "/data/crowdsec/templates/" + fi + done +fi \ No newline at end of file