Periodic email about security notifications
Brian Ledbetter
brian at shadowcom.net
Sat May 3 14:47:47 PDT 2003
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 at shadowcom.net>
http://www.shadowcom.net/brian/
-------------- next part --------------
--- 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=$? ;;
More information about the freebsd-hackers
mailing list