128263Spst#!/bin/sh
228263Spst#
350472Speter# $FreeBSD$
428263Spst#
528263Spst# Expire news articles
628263Spst# (This is present only for backwards compatibility, usually the news
728263Spst# system handles this on its own).
828263Spst
961981Sbrian# If there is a global system configuration file, suck it in.
1061981Sbrian#
1161981Sbrianif [ -r /etc/defaults/periodic.conf ]
1261981Sbrianthen
1361981Sbrian    . /etc/defaults/periodic.conf
1461981Sbrian    source_periodic_confs
1528263Spstfi
1661981Sbrian
1761981Sbriancase "$daily_news_expire_enable" in
1861981Sbrian    [Yy][Ee][Ss])
1965843Sbrian	if [ ! -f /etc/news.expire ]
2061981Sbrian	then
2165843Sbrian	    echo '$daily_news_expire_enable is set but /etc/news.expire' \
2265843Sbrian		"doesn't exist"
2365843Sbrian	    rc=2
2465843Sbrian	else
2561981Sbrian	    echo ""
2661981Sbrian	    echo "Running news.expire:"
2761981Sbrian
2865843Sbrian	    /etc/news.expire && rc=0 || rc=3
2961981Sbrian	fi;;
3065843Sbrian
3165843Sbrian    *)  rc=0;;
3261981Sbrianesac
3365843Sbrian
3465843Sbrianexit $rc
35