# cat /usr/local/sbin/maintain_pftables #!/bin/sh #lets clear old entries from the tables /sbin/pfctl -t ssh_attack -T expire 1209600 /sbin/pfctl -t irc_attack -T expire 86400 #save the ssh_attack table /sbin/pfctl -t ssh_attack -T show > /etc/pftable_ssh_attack #save the irc_attack table /sbin/pfctl -t irc_attack -T show > /etc/pftable_irc_attack #save the irc_hubs table /sbin/pfctl -t irc_hubs -T show > /etc/pftable_irc_hubs #save the whitelist table /sbin/pfctl -t whitelisted_hosts -T show > /etc/pftable_whitelisted_hosts #save the backuphost table /sbin/pfctl -t backup_hosts -T show > /etc/pftable_backup_hosts # crontab -l | grep pftable @hourly /usr/local/sbin/maintain_pftables > /dev/null 2>&1