From owner-freebsd-questions@freebsd.org Fri Mar 31 10:27:24 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 16EEBD26A61 for ; Fri, 31 Mar 2017 10:27:24 +0000 (UTC) (envelope-from starikarp@yandex.com) Received: from forward5o.cmail.yandex.net (forward5o.cmail.yandex.net [37.9.109.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5D00CDD for ; Fri, 31 Mar 2017 10:27:23 +0000 (UTC) (envelope-from starikarp@yandex.com) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b6:6]) by forward5o.cmail.yandex.net (Yandex) with ESMTP id 766BE20E5F for ; Fri, 31 Mar 2017 13:27:14 +0300 (MSK) Received: from smtp1p.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1p.mail.yandex.net (Yandex) with ESMTP id 49E9F1780CB7 for ; Fri, 31 Mar 2017 13:27:13 +0300 (MSK) Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id CQ4uf2UFXY-RCs05dSX; Fri, 31 Mar 2017 13:27:12 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1490956033; bh=tQITU/bEvO5jZXT0KXS9SQRKstnbzsBcNirY1xan1Zc=; h=Message-ID:Subject:From:To:Date; b=cO8YbAaJfgtppRCEiPnEj86nbHJNnAOqXaezJzneFJyzaqgR6UM3KROQPR39HKEEl WgGypIAlB2ZTFgPi4JUqBUROfB+0ttdA0fHTAAHRrCViOFFrUQaAvsottJtN25rXEL AI89cOVRI9c1CUwhvaSs5z6SFlTQ7hqP03Npp2SM= Authentication-Results: smtp1p.mail.yandex.net; dkim=pass header.i=@yandex.com X-Yandex-Suid-Status: 1 0 Message-ID: <1490956030.21333.2.camel@yandex.com> Subject: sndio From: Stari Karp To: FreeBSD Questions Date: Fri, 31 Mar 2017 06:27:10 -0400 X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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: Fri, 31 Mar 2017 10:27:24 -0000 Hi! I am  using Synth for ports and I got a problem with port sndio. I thoughtpkg is a problem but I am not sure. Thank you. Installing sndio-1.2.0_2... ===> Creating groups. Using existing group '_sndio'. ===> Creating users Creating user '_sndio' with uid '702'. pw: user '_sndio' disappeared during update pkg: PRE-INSTALL script failed Unfortunately, the system upgraded failed. From owner-freebsd-questions@freebsd.org Fri Mar 31 12:37:08 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 A5E7BD23B3E for ; Fri, 31 Mar 2017 12:37:08 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wr0-x22d.google.com (mail-wr0-x22d.google.com [IPv6:2a00:1450:400c:c0c::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 439FF797 for ; Fri, 31 Mar 2017 12:37:08 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wr0-x22d.google.com with SMTP id k6so98945892wre.2 for ; Fri, 31 Mar 2017 05:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=bdYLSIpZoIYBVrN8+RD2Pa6vldLOpFHy69E+qBJ6q1o=; b=nea6uIoqbXxNZW6tq2E+ZJOzp5kmaoT6eqSizSE1IaxP4PfetsDHfJF/iIxJv0uuEc TSEtubRpHXywB6+bxABMUXCcgSk/d6UCq2XznUsMYwY8/7hVE13TFVNEpA1hBraBuHw0 +N2HqZ4etzeN3b2CDZZnN0V4GscnkITMZKaykYYcEeV1cgMNqbzTn45UV5FDckC3HitN iUL2dVuMNkYUzUAv+h5S9ZA8Lgc7/2chDw/KtQZBhyCYjVcEzbOyOUvR01qNtXGG4zDi 9nFfJLySJp5aWS7JhvXjZ+3p08iqXiFp39FPyfMZgK8Wr33b4MBuKyIxC07+uQxUSZcS pKLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bdYLSIpZoIYBVrN8+RD2Pa6vldLOpFHy69E+qBJ6q1o=; b=VQu6N1QodyzgOA8sLRKw5YHPntV/9Vr871E5LxahHd3BGV0W87GguC3dY3TOrgErHV UDt3OUR4IZh6hL3BNT1I1VSSi861yLeIh/v564cYG02UJ7ySkTiDt71LrIFgDH2+hCwg pj9BI3+g0c5B+FxCmHxQUTgpmfyoO1Xesyv9w0I7PMuEO4yi0Onj0+hOS/McmKu9P8ON Ght0BbwOh4wwS8SJmFjKv1iCbqKWMsISrwZW4hsKNmdlVbhftJv5cG0ah8IoAVfmPRw2 +fFVUr5dMTDXAWvq5uFk/GooXyvQIN6p/FOygyNQEHv575vYFttMsSr7DcRsVYCX+4fa EV9g== X-Gm-Message-State: AFeK/H3A2M3JfV1ITrMTFm2LNqBTFQid+x/dBcdyTGIv2XXI2ldBelIxGoQWWb43+fJC0g== X-Received: by 10.28.135.21 with SMTP id j21mr2571349wmd.70.1490963826369; Fri, 31 Mar 2017 05:37:06 -0700 (PDT) Received: from gumby.homeunix.com ([81.17.24.158]) by smtp.gmail.com with ESMTPSA id y65sm6568937wrb.50.2017.03.31.05.37.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 31 Mar 2017 05:37:05 -0700 (PDT) Date: Fri, 31 Mar 2017 13:37:03 +0100 From: RW To: freebsd-questions@freebsd.org Subject: Re: shell script guru Message-ID: <20170331133703.4c172c6d@gumby.homeunix.com> In-Reply-To: References: X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd10.3) 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: Fri, 31 Mar 2017 12:37:08 -0000 On Thu, 30 Mar 2017 23:56:08 -0400 David Mehler wrote: > Here's the script that I put in monthly: > > #!/bin/sh > # > # Monthly retrieve the selected country IP block lists > # Retrieves dns zones from ipdeny.com > # Adds the zones to a country block file > # Then adds them to a pf block table > > # If there is a global system configuration file, suck it in. > # > if [ -r /etc/defaults/periodic.conf ] > then > . /etc/defaults/periodic.conf > source_periodic_confs > fi > > case "$monthly_country_blocks_enable" in > [Yy][Ee][Ss]) > cd /tmp As a general rule you should use mktemp, there's less to go wrong and it's more secure. > echo "Retrieving Zones" > for i in "af" "al" "dz" "am" "az" "ba" "br" "kh" "cf" "cn" "co" "cr" > "hr" "cu" "cy" "cz" "do" "eg" "fr" "gi" "ht" "ir" "iq" "jp" "jo" "kz" > "kp" "kr" "kw" "lb" "li" "ni" "ne" "ng" "om" "pk" "qa" "ro" "ru" "sa" > "rs" "so" "za" "sy" "tj" "tr" "tm" "ae" "uz" "vn" "ye" ; > do > wget -4 --no-proxy --no-cookies --no-cache > --append-output=/var/log/wget.log > http://ipdeny.com/ipblocks/data/countries/$i.zone IIWY I'd cd to a directory where the files can be stored persistently, so if the something goes wrong you can keep the last good copy of each file. fetch "$serverdir/$i.zone" && mv $i.zone $i.ips then after the loop: cat *.ips > blocked_countries mv blocked_countries /etc/pf/ For anything that's BSD specific it's better to use fetch if you can. If you use wget you should check that it's installed at runtime. > cat $i.zone >>/tmp/blocked_countries Note that this will create blocked_countries even if $i.zone doesn't exist, so your script would install a completely empty file over a working file if the server/network is down or wget is missing.