#!/bin/sh
#
# This script is called when ppp connects to the network.
# It pulls in news with slrnpull.
#
# Written By Joey Hess <joeyh@debian.org>

DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND

# Use debconf.
. /usr/share/debconf/confmodule

# If term is not set to something sane, slrn gets upset.
TERM=vt100
export TERM

# Make sure the umask is sane as well.
umask 022

# Fetch news.
db_get slrnpull/run_from
if [ "$RET" = "ip-up" ] ; then
	# Get new articles.
	slrnpull -h `cat /etc/news/server` & >/dev/null
fi
