#!/usr/bin/env bash## Script to download Spamhaus IPv4 and IPv6 DROP list# This script converts the json to a text file.#main() { local url="https://www.spamhaus.org/drop/drop_v4.json" local urlv6="https://www.spamhaus.org/drop/drop_v6.json" local output_file="/www/opnsense/spamhaus-drop_v4.txt" local output_filev6="/www/opnsense/spamhaus-drop_v6.txt" curl -s $url | jq -r 'select(.cidr != null) | .cidr' >$output_file curl -s $urlv6 | jq -r 'select(.cidr != null) | .cidr' >$output_filev6}main# Optional# echo -e "IP addresses have been extracted:\nIPv4: $output_file\nIPv6: $output_filev6"