home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- # rmgroup group
- #
- # Modified by Chip Salzenberg, 7 June 1990.
- # Send mail to Usenet administrator describing the rmgroup request.
- # But if group doesn't exist, don't bother.
-
- # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
- . ${NEWSCONFIG-/usr/lib/news/bin/config}
- export NEWSCTL NEWSBIN NEWSARTS
- PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
- umask $NEWSUMASK
-
- afile=/tmp/ncd
- afilehdr=/tmp/ncdhdr
- afilebody=/tmp/ncdbody
- hdr=/tmp/nc$$
-
- trap "exit 1" 1 2 3 13 15
- trap "rm -f $hdr $afile $afilehdr $afilebody; exit 0" 0
-
- $NEWSBIN/inject/tear $afile
- $NEWSBIN/canonhdr <$afilehdr >$hdr
-
- # unapproved ctl msg? then quit
- egrep '^Approved:' $hdr >/dev/null || { rm -f $afile*; exit 0; }
-
- # quit if no active entry
- egrep "^`echo $1 | sed 's/\./\\\\./g'` " $NEWSCTL/active >/dev/null || exit 0
-
- SENDER="`grep '^Sender:' $hdr | sed 's/^[^:]*: *//'`"
- case "$SENDER" in
- "") SENDER="`grep '^From:' $hdr | sed 's/^[^:]*: *//'`" ;;
- esac
-
- # tell the local usenet administrator to do it by hand
- G="$1"
- ( echo "$SENDER says"
- echo "to remove the group '$G',"
- echo "and adds this comment:";
- cat $afilebody ) |
- mail -s "rmgroup $G" $NEWSMASTER
-