From owner-freebsd-questions@freebsd.org Tue Mar 28 09:17:04 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47F2ED22AF0 for ; Tue, 28 Mar 2017 09:17:04 +0000 (UTC) (envelope-from ralf.mardorf@rocketmail.com) Received: from nm30.bullet.mail.ir2.yahoo.com (nm30.bullet.mail.ir2.yahoo.com [212.82.96.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB12EB53 for ; Tue, 28 Mar 2017 09:17:03 +0000 (UTC) (envelope-from ralf.mardorf@rocketmail.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s2048; t=1490692615; bh=GMFhj/dqEH54G1N6wr2dIKoYNpapaCaYgU6JgBEwrtY=; h=Date:From:To:Subject:In-Reply-To:References:From:Subject; b=Ad65tNJaM8YNzMHKDNcBtPM5LpglY+3eXCiWcHvEzEYzjZpXJAaifD1hbuYSikILLP4bbT0FxdzXZS0VOsYR9lBd441no2dQAMMCIotSV2UglWXdVyoL32HruaVH3nBw2OC6m2gBPy/WbERLPOHbmosZY0leCE9Y4tTN3Zf1s+K6PiCkceOgAjtZrm5/dX5l29yUdsfqeYHMG31QC7be8kfmh18yy/sHZP6M6cw69Rh+hDJgC7QGdaQfQpW8nP/EvKCjVFfKRfdgeM/kCIz9Zqlqxa9+2SloNixS61timoeWUEhmMi8INg8sTSaN0QnsvRToXNgT7t4oOQIqedMEuA== Received: from [212.82.98.51] by nm30.bullet.mail.ir2.yahoo.com with NNFMP; 28 Mar 2017 09:16:55 -0000 Received: from [46.228.39.95] by tm4.bullet.mail.ir2.yahoo.com with NNFMP; 28 Mar 2017 09:16:55 -0000 Received: from [127.0.0.1] by smtp132.mail.ir2.yahoo.com with NNFMP; 28 Mar 2017 09:16:55 -0000 X-Yahoo-Newman-Id: 595548.66482.bm@smtp132.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: kvgTGFIVM1kTPUt9HbbY9yjbU7G7h1ecBlmW6JrbPPQ.BAc 6LascPS4fy2j3UxUFwOQirBCOORBRXx5QQDDQo6.jWV2CxU34M7HZhFNQPZ4 wtPeQ8n108lKE09I1IYNJRLR3wdw1h5BDz4zq3sY8lExDXVDO4GoULrNi2.N 9MvLOq3KfxnJCFmPGx2Ce1XQ42ritF0K6TSuy40SHRzkUPyF3M41uSq1w1I4 huXRPQ3seITsk5aJcowAlcpyAv1FeN8ihN8pUgOBgc29u3D8wAmO5t5HmnT7 yTU5fCq9IMtUNvAvtt4zGQSuVAXg.NTtLxJ0h9.cELgwoqzf9d0OfjaJgJ.H Ktpm569brp4moI9ghe9yNF73i8qWI.8ZUAD1b013b2W484xgYsWrQnUMmUA5 20p9.uhex7QN4nsoN16fTtxBDi4QXY37CwxhUmPZn3V.qiOc4i2r31yTmo2Y l0jTybWPwdzn4hvw5IXPJQ1RpS97_VbNt43333Sswf1h0AkJ54I5HYgE_c9w bP7Jw5KkpP7M24_nYf2q1gOxo8ptEw0N0E8Vi26RpUQ3YYRAjtclxP4cfXET QSTnHK1_YHXMA1BRsRctxll1S1w-- X-Yahoo-SMTP: BeMCPs2swBABTJ3kAeEiC_hE0mz8jRexLddJfD8pI2j32fOacjBmXg-- Date: Tue, 28 Mar 2017 11:16:55 +0200 From: Ralf Mardorf To: freebsd-questions@freebsd.org Subject: Re: Two pf questions Message-ID: <20170328111655.121ede18@archlinux.localdomain> In-Reply-To: References: <20170327170941.59c84eec@archlinux.localdomain> <20170327171959.405bbfbb@archlinux.localdomain> X-Mailer: Claws Mail 3.15.0-1-g9782061 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 09:17:04 -0000 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 > >ie > >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.