26 lines
742 B
Bash
26 lines
742 B
Bash
#! /bin/bash
|
|
|
|
|
|
#### Variables ####
|
|
seedlist_dir=/var/lib/ipset
|
|
update=/usr/local/bin/ufw-blocklists.sh
|
|
blists=$(find "$seedlist_dir" -name "*-inet.save")
|
|
|
|
#### Check for SeedList Dir ####
|
|
if [ ! -d "$seedlist_dir" ]; then
|
|
echo "ERROR: ipset data directory does not exist" >&2
|
|
exit 2
|
|
fi
|
|
|
|
#### Update Loop ####
|
|
for seeds in $blists
|
|
do
|
|
seedlists=$(basename -s ".save" "$seeds")
|
|
if [ "$seedlists" = bl-feodoc2-inet ]; then
|
|
$update -l "feodoc2 https://feodotracker.abuse.ch/downloads/ipblocklist_recommended.txt"
|
|
fi
|
|
|
|
if [ "$seedlists" = bl-feodoc2ioc-inet ]; then
|
|
$update -l "feodoc2ioc https://feodotracker.abuse.ch/downloads/ipblocklist.txt"
|
|
fi
|
|
done |