1
24.1 Production Series / Re: Create Alias from JSON format
« Last post by Legally a Shrimp on Today at 09:24:05 pm »I'm rather new to using opnSense, but I'd just manually add a cronjob to execute a one-liner such as
Code: [Select]
curl -s "https://www.spamhaus.org/drop/drop_v6.json" | python3 -c "import json, sys; print('\n'.join([v['cidr'] for v in json.loads('[' + ','.join(sys.stdin.read().split('\n'))[:-1] + ']') if 'cidr' in v]))" >/usr/local/www/aliases_spamhaus_dropv6.txt
and add an "URL Table (IPs)" alias for http://localhost/aliases_spamhaus_dropv6.txt if I really, really wanted to use that JSON file