#! /bin/sh
# delsendsys - mail sys file to sender identified in stdin's headers

# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/etc/news/bin/config}

PATH=$NEWSCTL/bin:$NEWSBIN/relay:$NEWSBIN:$NEWSPATH ; export PATH
umask $NEWSUMASK

replyto="`newsreply`"
(
	echo "To: $replyto"
	echo "Subject: response from `newshostname` to your sendsys request"
	echo
	echo "Responding-System: `cat $NEWSCTL/mailname`"
	case "$1" in
	"")	cat $NEWSCTL/sys ;;
	*)	awk -f $NEWSBIN/canonsys.awk $NEWSCTL/sys |
						awk '$1 == "'"$1"'"'	;;
	esac
) | sed '/^~/s/^/***/' | mail "$replyto"

report 'sendsys processed' <<!
$NEWSCTL/sys file has been sent to $replyto.
Please remain calm.  DON'T PANIC.  This is perfectly routine.
Your sys file is public information by definition.
This is a requirement of membership in Usenet.
Please don't waste everyone's time by asking about this on Usenet
or by harassing the person who sent the sendsys control message.
!
