#!/bin/sh

#	This script will issue a local rmgroup control message for
#	alt.silly.group.names.stupid.stupid.stupid.  While you are in your
#	mail client reading one of inn's newgroup notification messages, just
#	pipe it into this script without any parameters.  Or you can invoke
#	the script manually with the offending newsgroup name as the only
#	parameter.  The author's version of this script is available from:
#
#		ftp://ftp.cccd.edu/pub/usenet/innzap
# 
#       Permission is freely granted to modify and redistribute this code as 
#       long as credit is given to the author: 
# 
#               Mark Bixby 
#               Coast Community College District 
#               District Information Services 
#               1370 Adams Avenue 
#               Costa Mesa, CA  92626 
#               USA 
#               e-mail: markb@cccd.edu
#               phone: +1 714 432 5064

case $# in
	0) bogus=`grep "^Subject: newgroup " | head -n 1 | awk ' { print $3 }'`
	   echo "Begone, bogus newsgroup!" | inews -n $bogus -c "rmgroup $bogus" -d local -r $REPLYTO -a $REPLYTO
	   ;;
	1) echo "Begone, bogus newsgroup!" | inews -n $1 -c "rmgroup $1" -d local -r $REPLYTO -a $REPLYTO ;;
	*) echo "$0: correct syntax is $0 [news.group.name]" ;;
esac
