From owner-freebsd-hackers@FreeBSD.ORG Sat May 3 14:47:47 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0532437B401 for ; Sat, 3 May 2003 14:47:47 -0700 (PDT) Received: from lakemtao03.cox.net (lakemtao03.cox.net [68.1.17.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE9FE43F3F for ; Sat, 3 May 2003 14:47:44 -0700 (PDT) (envelope-from brian@shadowcom.net) Received: from shadowcom.net ([68.100.212.237]) by lakemtao03.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with SMTP id <20030503214743.NTHY23518.lakemtao03.cox.net@shadowcom.net> for ; Sat, 3 May 2003 17:47:43 -0400 Received: (qmail 22890 invoked by uid 500); 3 May 2003 21:48:14 -0000 Date: Sat, 3 May 2003 17:48:14 -0400 From: Brian Ledbetter To: Giorgos Keramidas Message-ID: <20030503214814.GD21307@shadowcom.net> References: <20030503204938.GA3907@gothmog.gr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline In-Reply-To: <20030503204938.GA3907@gothmog.gr> User-Agent: Mutt/1.4i cc: freebsd-hackers@freebsd.org Subject: Re: Periodic email about security notifications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 May 2003 21:47:47 -0000 --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Ok, so /usr/bin/fetch isn't really suited for this, as I'm sure you knew already. My bad. Here is a patched version which will do the same thing with /usr/bin/ftp. I hope it works for you. (As a side note, in your code, you set $sa_url initially, but never use it later. I fixed that with this patch, too.) Regards! B On Sat, May 03, 2003 at 11:49:38PM +0300, Giorgos Keramidas wrote: > Hi all, > > A friend asked me a while ago on IRC if it was possible to receive > periodic email notifications with new security advisories. > > The following script for /etc/periodic/security implements exactly this > idea. It depends on lynx(1) to run, which isn't part of the base > system, so I'm not sure if it's ok to add it to the base system at all. > Here it is for anyone who might find it useful though: -- Brian Ledbetter http://www.shadowcom.net/brian/ --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="security-advisory.patch" --- 999.security-advisory.orig Sat May 3 17:47:05 2003 +++ 999.security-advisory Sat May 3 17:46:32 2003 @@ -27,7 +27,7 @@ # $FreeBSD$ # -sa_url='ftp://ftp.jp.freebsd.org/pub/FreeBSD/CERT/advisories/' +sa_url='ftp://ftp2.freebsd.org/pub/FreeBSD/CERT/advisories/' # If there is a global system configuration file, suck it in. # @@ -46,8 +46,8 @@ echo "" echo 'Checking for new security advisories or notifications:' - lynx -dump ftp://ftp.jp.freebsd.org/pub/FreeBSD/CERT/advisories/ | \ - grep 'text/plain[[:space:]].*\]FreeBSD-S[AN]-' | sort | \ + echo ls \*.asc | /usr/bin/ftp $sa_url 2>&1 | \ + grep 'FreeBSD-S[AN]-' | awk '{ print $9 }' | sort | \ sed -e 's/^.*]//' -e 's/ .*$//' -e 's|^| '"${sa_url}"'|' | \ check_diff advisory - "${host} security advisories:" rc=$? ;; --bg08WKrSYDhXBjb5--