home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff319.lzh / CNewsSrc / cnews.orig.lzh / relay / ctl / rmgroup < prev    next >
Text File  |  1989-06-27  |  710b  |  32 lines

  1. #! /bin/sh
  2. # rmgroup group - snuff group
  3.  
  4. # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
  5. . ${NEWSCONFIG-/usr/lib/news/bin/config}
  6. export NEWSCTL NEWSBIN NEWSARTS
  7. PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
  8. umask $NEWSUMASK
  9.  
  10. F=/tmp/nc$$
  11.  
  12. cat >$F
  13.  
  14. # unapproved ctl msg? then quit
  15. egrep '^Approved:' $F >/dev/null || { rm -f $F; exit 0; }
  16.  
  17. # quit if no active entry
  18. egrep "^`echo $1 | sed 's/\./\\\\./g'` " $NEWSCTL/active >/dev/null ||
  19.     { rm -f $F; exit 0; }
  20.  
  21. SENDER="`grep '^Sender:' $F | sed 's/^[^:]*: *//'`"
  22. case "$SENDER" in
  23. "")
  24.     SENDER="`grep '^From:' $F | sed 's/^[^:]*: *//'`"
  25.     ;;
  26. esac
  27.  
  28. # tell the local usenet administrator to do it by hand
  29. echo "rmgroup $1 says $SENDER" | mail $NEWSMASTER
  30.  
  31. rm -f $F*
  32.