Path: utzoo!utstat!helios.physics.utoronto.ca!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!samsung!cs.utexas.edu!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!hal!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery) Newsgroups: news.software.b Subject: Re: C news configuration options vs B news same Message-ID: <1989Dec6.014046.20687@NCoast.ORG> Date: 6 Dec 89 01:40:46 GMT References: <1989Dec5.080052.3532@aai.uucp> <1989Dec5.172135.27648@utzoo.uucp> <1989Dec5.183224.27127@polyslo.CalPoly.EDU> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery) Followup-To: news.software.b Organization: North Coast Public Access UN*X, Cleveland, OH Lines: 74 While we're on the subject of alternative newgroup control message handlers, here's ncoast's hack on the standard one. It traps alt groups and requests manual creation; just the thing for those of you who are sick of seeing all the newgroups for alt.stupidity, alt.weemba.all, etc. ;-) -----------------------------------cut here----------------------------------- #! /bin/sh # newgroup group flag - create group (4-field version: B-2.10.3+ compatible) # subject to our sys file group pattern # =()<. ${NEWSCONFIG-@@}>()= . ${NEWSCONFIG-/usr/lib/news/bin/config} export NEWSCTL NEWSBIN NEWSARTS PATH=$NEWSCTL/bin:$NEWSBIN/relay:$NEWSBIN:$NEWSPATH ; export PATH # include mkpdir umask $NEWSUMASK F=/tmp/nc$$ trap "rm -f $F; exit 0" 0 cat >$F # unapproved ctl msg? then quit grep -s '^Approved:' $F >/dev/null || { rm -f $F; exit 0; } SENDER="`grep '^Sender:' $F | sed 's/^[^:]*: *//'`" case "$SENDER" in "") SENDER="`grep '^From:' $F | sed 's/^[^:]*: *//' `" ;; esac greppat="^`echo $1 | sed 's/\./\\\\./g' ` " if grep -s "$greppat" $NEWSCTL/active >/dev/null; then # group exists? export SENDER chamod "$1" "$2" # change moderated flag if needed exit fi me="`newshostname`" gngppat=`awk -f $NEWSBIN/relay/canonsys.awk $NEWSCTL/sys | egrep "^($me|ME):" | awk -F: ' { fields = split($2, field2, "/") # split ngs/dists print field2[1] # print only ngs exit }' ` if gngp -a alt >/dev/null </dev/null <>$NEWSCTL/active (echo "$1 `getdate now` $SENDER" >>$NEWSCTL/active.times) # rn hook # make the directory since rn will bitch if it's missing mkpdir $NEWSARTS/`echo $1 | tr . / ` echo "newsgroup $1 was created by $SENDER." | mail $NEWSMASTER fi -----------------------------------cut here----------------------------------- ++Brandon -- Brandon S. Allbery allbery@NCoast.ORG, BALLBERY (MCI Mail), ALLBERY (Delphi) uunet!hal.cwru.edu!ncoast!allbery ncoast!allbery@hal.cwru.edu bsa@telotech.uucp *(comp.sources.misc mail to comp-sources-misc[-request]@backbone.site, please)* *Third party vote-collection service: send mail to allbery@uunet.uu.net (ONLY)* expnet.all: Experiments in *net management and organization. Mail me for info.