185909Simp#!/bin/sh
285909Simp#
3101877Sjmallett# $FreeBSD$
485909Simp#
585909Simp# Expire news articles
685909Simp# (This is present only for backwards compatibility, usually the news
785909Simp# system handles this on its own).
885909Simp
985909Simp# If there is a global system configuration file, suck it in.
1085909Simp#
1185909Simpif [ -r /etc/defaults/periodic.conf ]
1285909Simpthen
1385909Simp    . /etc/defaults/periodic.conf
1485909Simp    source_periodic_confs
1585909Simpfi
1691512Sobrien
1785909Simpcase "$daily_news_expire_enable" in
1885909Simp    [Yy][Ee][Ss])
1985909Simp	if [ ! -f /etc/news.expire ]
2085909Simp	then
2185909Simp	    echo '$daily_news_expire_enable is set but /etc/news.expire' \
2285909Simp		"doesn't exist"
2385909Simp	    rc=2
2485909Simp	else
2585909Simp	    echo ""
2685909Simp	    echo "Running news.expire:"
2785909Simp
2885909Simp	    /etc/news.expire && rc=0 || rc=3
2985909Simp	fi;;
3085909Simp
3185909Simp    *)  rc=0;;
3285909Simpesac
3385909Simp
3499932Sbdeexit $rc
3589180Smsmith