#!/bin/sh ####################################################################### #Script Name: pfloadtable #Version: 1.3 #Description: Script to at reboot load list of abuse ips from the pf #firewall on the Server. This runs @reboot in cron. #Last Modify Date: 01062021 #Author:Brent Dacus #Email:brent[at]thedacus[dot]net ####################################################################### # Main # ####################################################################### #extract just the ips from the file Directamin BFM adds whitespace and a date. cat /usr/local/etc/blocked_ips | sed -e 's/^[ \t]*//;s/=.*//' >/usr/local/etc/blocked_ips.temp #load to pf firewall table /sbin/pfctl -t bruteforce -T add -f /usr/local/etc/blocked_ips.temp #remove the temp file. rm /usr/local/etc/blocked_ips.temp #clear DA brute lists :>/usr/local/directadmin/data/admin/brute_ip.data :>/usr/local/directadmin/data/admin/brute_log_entries.list exit 0