#!/bin/sh
#
# Cron.daily script for slrnpull.
# Written By Joey Hess <joeyh@debian.org>

[ -x /usr/bin/slrnpull ] || exit 0

if [ -f /etc/default/slrnpull ]; then
	. /etc/default/slrnpull
fi

cd /var/spool/slrnpull

# Perform expiration, even if we arn't fetching articles right now.
su news -c slrnpull -- --expire >/dev/null

if  [ "$RUNFROM" = "cron job" ] ; then
	# Get new articles.
	su news -c slrnpull -- -h `head -1 /etc/news/server` >/dev/null
fi
