From owner-freebsd-questions@freebsd.org Tue Mar 28 09:45:50 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 AA910D1D8F8 for ; Tue, 28 Mar 2017 09:45:50 +0000 (UTC) (envelope-from ralf.mardorf@rocketmail.com) Received: from nm8-vm6.bullet.mail.ir2.yahoo.com (nm8-vm6.bullet.mail.ir2.yahoo.com [212.82.96.140]) (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 2883F309 for ; Tue, 28 Mar 2017 09:45:49 +0000 (UTC) (envelope-from ralf.mardorf@rocketmail.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rocketmail.com; s=s2048; t=1490694342; bh=IfMKyxLAknu2fKZKl/n6ORDIzrDuEvMCXtFvXVJ/Wo0=; h=Date:From:To:Subject:In-Reply-To:References:From:Subject; b=ga4UJIfoHuTwxvH1TjOkmfNTvfSf9cxxqrPWPAqZHMhF+jTRAEoX8V799p5mvpf0ZROCN6e10VJjX00CcdaPWUkwKHAvPSiSXKoZZS+u2SVIjExjJt4qdyIDnl/J+L00XRL0xF04DfooE70zHXq4Rr7kV+wCilz6SfxsfDWDyijZI4RvsroGH1WR5G+0Vo93PeUeOJlysPJaNRY9R3c04LC6kcKmsj4jY+yIPgRURKpJS4a1X5Wy6fVME65bzQvMuA0X/74H7zzw3B99pWsw9NJfvQ/zu+6VAf+dTYENMVa/b7Z7Y5rxbyv4RVNXfeBuLT795Zc4rP4ofveWS5IRBw== Received: from [212.82.98.54] by nm8.bullet.mail.ir2.yahoo.com with NNFMP; 28 Mar 2017 09:45:42 -0000 Received: from [46.228.39.113] by tm7.bullet.mail.ir2.yahoo.com with NNFMP; 28 Mar 2017 09:45:42 -0000 Received: from [127.0.0.1] by smtp150.mail.ir2.yahoo.com with NNFMP; 28 Mar 2017 09:45:42 -0000 X-Yahoo-Newman-Id: 87477.93542.bm@smtp150.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: HVpKd4EVM1lfwYGO9wYPSxsKrV8reBSLgzTx3PmG30dF2mC wIL_8ivhBRF2LxvB3tnBJppRfecqXY5DD19SYHleTAYNSvz6yicHqsglnnhY 7Vb3eFxboYFnswZRWkvziooZ4alhmWibFNlX39HEatGNsIXaH1v7EN2c8PTk .6UKcAxSy9CKC.Ns9ZNoezauk7tNL_fzaQf117aQNBIUPFmPvvvLZL5MhDQf B80KXU0dCLVn_NV7XdJj4n40mvcZxt4i11XibSSYgpOpYtTqIkcPZ_Ow9UCx eP.Lo6WbJ1RT0m2N.QBQ1kGiqVtIPey6hNNjxkrLFT8n4YmlbJpbCVGUDBVB JJrwW7DDo46tBJaLY1orA7rMLmXbRZdymPN3Doo5eqRP2Cuf.RQxulVfwgsQ VB4oVqTXXodNO_I0CCk0RnKIyXB5rkAy3e4B6pYhapAWMSF8W_8dnV5bVeO4 6Us_QBARwkJlQN6gP6G13uIS4H4cnfinrSLMZKvtIIbs5TPyyP.A2lYR9Qqu Bdc2rRIlMPa5sXuvggR33Yhj1XffyvCsx3eTv9yWMnaFaoVKUbGBhu.XQFI3 Ff7L5ipPAqzVGQ1bMen0E590zZQ-- X-Yahoo-SMTP: BeMCPs2swBABTJ3kAeEiC_hE0mz8jRexLddJfD8pI2j32fOacjBmXg-- Date: Tue, 28 Mar 2017 11:45:41 +0200 From: Ralf Mardorf To: freebsd-questions@freebsd.org Subject: Re: Two pf questions Message-ID: <20170328114541.0ca0d084@archlinux.localdomain> In-Reply-To: <20170328113501.2a5ebf60@archlinux.localdomain> References: <20170327170941.59c84eec@archlinux.localdomain> <20170327171959.405bbfbb@archlinux.localdomain> <20170328111655.121ede18@archlinux.localdomain> <20170328111959.400d4761@archlinux.localdomain> <20170328113501.2a5ebf60@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:45:50 -0000 On Tue, 28 Mar 2017 11:35:01 +0200, Ralf Mardorf wrote: >On Tue, 28 Mar 2017 11:19:59 +0200, Ralf Mardorf via freebsd-questions >wrote: >>cp /etc/pf/bruteforce /tmp/foobar.txt >>pfctl -t bruteforce -T show >> /tmp/foobar.txt >>sort -u /tmp/foobar.txt > /etc/pf/bruteforce >> >>^ >>^ >> >>>If so, the above example with "sort -u" still might be good. >>>Perhaps >> ^^^^^^^^^^^^^ >> ^^^^^^^^^^^^^ the above with the cp to a backup file >> >>>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 clear, something similar to this: > >cp /etc/pf/bruteforce /tmp/foobar.txt && \ >pfctl -t bruteforce -T show >> /tmp/foobar.txt && \ >some_loop > sort -u /tmp/foobar.txt > /etc/pf/bruteforce > check_exit_status >some_loop My apologies, it's not my day today ;). I don't know if the exit status available after sort -u /tmp/foobar.txt > /etc/pf/bruteforce is from "sort" and/or ">", at least sort -u /tmp/foobar.txt | tee /etc/pf/bruteforce ensures that it's the status returned from "tee", but I suspect ">" works, too.