Xref: utzoo news.admin:9005 news.software.b:4882 Path: utzoo!utstat!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!tale From: tale@cs.rpi.edu (David C Lawrence) Newsgroups: news.admin,news.software.b Subject: Re: remind me again. manual newgroups for C news ? Message-ID: Date: 1 Jun 90 17:32:16 GMT References: Organization: Rensselaer Polytechnic Institute, Troy NY Lines: 78 Here, I just did this today to my existing newgroup script when I noticed the first bogus one come in (misc.sheep, I think) in anticipation of many more. I intend to revert it again after this weekend. Basically all that means is changing the first case patterns back to "alt.*" from "*" and uncommenting the code lines. #! /bin/sh # newgroup group flag - create group (4-field version: B-2.10.3+ compatible) # subject to our sys file group pattern # edited 1 Nov 89 to send the whole article for inspection -- tale # edited 6 May 90 to not do automatic alt newgroups -- tale # edited 1 Jun 90 special transient version to deal with stupid forgeries. # yes, i know that the "alt" comment is wrong and a # case statement is useless there. "Transient." # =()<. ${NEWSCONFIG-@@}>()= . ${NEWSCONFIG-/usenet/bin.server/config} export NEWSCTL NEWSBIN NEWSARTS PATH=$NEWSCTL/bin:$NEWSBIN/relay:$NEWSBIN:$NEWSPATH ; export PATH # include mkpdir umask $NEWSUMASK hdr=/tmp/nc$$ art=/tmp/nc$$all trap "rm -f $hdr $art; exit 0" 0 cat > $art # tee: broken pipe: if cat | tee | canonhdr cat $art | canonhdr >$hdr # unapproved ctl msg? then quit grep -s '^Approved:' $hdr >/dev/null || { rm -f $hdr; exit 0; } SENDER="`grep '^Sender:' $hdr | sed 's/^[^:]*: *//'`" case "$SENDER" in "") SENDER="`grep '^From:' $hdr | 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 "$gngppat" >/dev/null <>$NEWSCTL/active ; # (echo "$1 `getdate now` $SENDER" >>$NEWSCTL/active.times) ; # # make the directory since rn will bitch if it's missing # mkpdir $NEWSARTS/`echo $1 | tr . / ` ;; esac ( case "$1" in *) echo "$SENDER attempted to create $1." ; echo "Use \"addgroup $1 $flag\" if you want to have it." ;; # *) echo "Newsgroup $1 was created by $SENDER." ;; esac ; echo ; echo "This was the control message:" ; echo ; cat $art ) | Mail -s "$1 created by $SENDER." $NEWSMASTER fi