#!/bin/ash
# rustic rpost 
# (C) 1998 M. Andreoli

#set -x

# Include nntp data

if [ -r /usr/script/nntp.conf ]; then
	. /usr/script/nntp.conf 
else #test
	. nntp.conf
fi


# Syntax

# skip -* options

while [ 1 ] ; do
case $1 in
-*) shift;;
*)  break;;
esac
done

NNTPSERVER=${1:-`cat /etc/nntpserver`}

if [ -z "$NNTPSERVER" ]; then 
echo "(rustic) rpost: Usage: `basename $0` [-*] nntpserver [ ignored ]"
exit 1
fi 


cat > ${ARTICLE_FILE}

# Start netcat client 

nc -v -w 60 -e $NNTP_PRO $NNTPSERVER nntp 
[ $? -eq 0 ] && echo "rpost: sent article to $NNTPSERVER."

# End
