#!/bin/sh
#
# This script is called when ppp/ifup connects to the network.
# It pulls in news with 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

if [ "$RUNFROM" = "ip-up" -a "$METHOD" != loopback ] ; then
	# Get new articles.
	su news -s /bin/sh -c 'slrnpull -h `head -n 1 /etc/news/server` >/dev/null'
fi
