From 89142acc4347252d6add53d84bf208c8ad6bf19b Mon Sep 17 00:00:00 2001 From: nox_x Date: Thu, 11 Jul 2024 16:32:20 +0200 Subject: [PATCH] enhancement: force hub index file update if hub data upgrade is forced --- docker/docker_start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/docker_start.sh b/docker/docker_start.sh index a3e9226bced..74218aaef01 100755 --- a/docker/docker_start.sh +++ b/docker/docker_start.sh @@ -55,8 +55,8 @@ cscli() { run_hub_update() { index_modification_time=$(stat -c %Y /etc/crowdsec/hub/.index.json 2>/dev/null) - # Run cscli hub update if no date or if the index file is older than 24h - if [ -z "$index_modification_time" ] || [ $(( $(date +%s) - index_modification_time )) -gt 86400 ]; then + # Run cscli hub update if forced to upgrade hub data, if no date or if the index file is older than 24h + if istrue "$DO_HUB_UPGRADE" || [ -z "$index_modification_time" ] || [ $(( $(date +%s) - index_modification_time )) -gt 86400 ]; then cscli hub update else echo "Skipping hub update, index file is recent"