#!/bin/bash
## This script accepts AFOS binary messages on its standard input, 
## zip's them, uu-encode's them, and posts them
## to the appropriate newsgroup

#
# usage:
#   wxbinnewspost <newsgroup> <Subject of article> <filename>
# Example:
#   wxbinnewspost ampr.ia.wx "Davenport RCM" dvnrcm
#
#
ORGANIZATION="NWS Skywarn"
FROMADDRESS="Skywarn Weather Daemon"
REPLYTOADDRESS=$LOGNAME
PATHPREFIX=wxdaemon
CLEANUPTOOL=/usr/sbin/wxclean

# zip -9 -q 
gzip -c | uuencode $3.gz | \
cat $POSTMESSAGE - | \
inews  -t"$2" -n"$1" -f"$FROMADDRESS" -o"$ORGANIZATION" -r"$REPLYTOADDRESS" -x"$PATHPREFIX" 
