github.com/crowdsecurity/crowdsec@v1.6.1/docker/preload-hub-items (about)

     1  #!/usr/bin/env bash
     2  
     3  set -eu
     4  
     5  # pre-download everything but don't install anything
     6  
     7  echo "Pre-downloading Hub content..."
     8  
     9  types=$(cscli hub types -o raw)
    10  
    11  for itemtype in $types; do
    12      ALL_ITEMS=$(cscli "$itemtype" list -a -o json | itemtype="$itemtype" yq '.[env(itemtype)][] | .name')
    13      if [[ -n "${ALL_ITEMS}" ]]; then
    14          #shellcheck disable=SC2086
    15          cscli "$itemtype" install \
    16              $ALL_ITEMS \
    17              --download-only \
    18              --error
    19      fi
    20  done
    21  
    22  echo " done."