Skip to content

Instantly share code, notes, and snippets.

@LaurenceJJones
Created October 13, 2022 14:57
Show Gist options
  • Save LaurenceJJones/d13326271ce79578af1ced82e4c71bb8 to your computer and use it in GitHub Desktop.
Save LaurenceJJones/d13326271ce79578af1ced82e4c71bb8 to your computer and use it in GitHub Desktop.
Cron script to fetch ip lists then store within /var/lib/crowdsec/data/
dir=/var/lib/crowdsec/data/
declare -a URLS=("https://quic.cloud/ips?ln,quiccloud_ips.txt" "https://monitoring.platform360.io/whitelist?v4,monitoring360_ips.txt" "https://monitoring.platform360.io/whitelist?v6,monitoring360_ip6s.txt" )
for i in ${URLS[@]}; do
IFS=, read -r url name <<< $i
/usr/bin/wget -q -O "$dir$name" "$url"
done
/usr/bin/systemctl restart crowdsec.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment