Two pf questions

Ralf Mardorf ralf.mardorf at
Tue Mar 28 09:17:04 UTC 2017

On Tue, 28 Mar 2017 09:47:30 +0100, krad wrote:
>> On Mon, 27 Mar 2017 17:09:41 +0200, Ralf Mardorf wrote:  
>> >cp /etc/pf/bruteforce /tmp/foobar.txt
>> >pfctl -t bruteforce -T show >> /tmp/foobar.txt
>> >sort -u /tmp/foobar.txt > /etc/pf/bruteforce
>The problem probably is that you are appending to you file not
>overwriting it. So drop the double >
>pfctl -t bruteforce -T show | sort -u > /etc/pf/bruteforce
>This will obviously loose the old contents of the file which you might
>not want, however you could just make sure you loaded the contents of
>the file into the table before you dump it

If so, the above example with "sort -u" still might be good. Perhaps
in addition within a loop until the exit status $? of the last command
is 0, to ensure that /etc/pf/bruteforcen doesn't get lost, if something
should went wrong.

More information about the freebsd-questions mailing list