# vi /usr/local/bin/blacklist_update.sh
#!/bin/bash cd /usr/local/bin mv list.txt old_list.txt old=$(wc -c < old_list.txt) wget http://voipbl.org/update -O - | sed -e '1d' > list.txt new=$(wc -c < list.txt) if [[ $new > $old ]] then fwconsole stop ipset flush BLACKLIST for ip in $(cat list.txt); do ipset -A BLACKLIST $ip;done ipset save < /etc/ipset.conf reboot else echo "BLACKLISTは最新です" fi
# chmod +x /usr/local/bin/blacklist_update.sh
# crontab -e
30 03 * * * /usr/local/bin/blacklist_update.sh
コメント