Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 May 2003 17:48:14 -0400
From:      Brian Ledbetter <brian@shadowcom.net>
To:        Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Periodic email about security notifications
Message-ID:  <20030503214814.GD21307@shadowcom.net>
In-Reply-To: <20030503204938.GA3907@gothmog.gr>
References:  <20030503204938.GA3907@gothmog.gr>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <brian@shadowcom.net>
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030503214814.GD21307>