home *** CD-ROM | disk | FTP | other *** search
- From: eastick@me.utoronto.ca (Doug Eastick)
- Newsgroups: alt.config,alt.sources,news.software.b
- Subject: manual newgroup for C news
- Message-ID: <90May22.235719edt.19970@me.utoronto.ca>
- Date: 23 May 90 03:57:28 GMT
-
- [Henry: can you add an auto/manual newgroup question to build to
- tailor this?]
-
- Since I'm passing on the usenet alias to someone else, I thought I'd
- ease the pain of all the stupid newgroups in alt.*. Now it just tells
- you to do an addgroup alt.dorkheads (aw jeez, now some dork will
- actually go out and do it!). Replaces $NEWSBIN/ctl/newgroup.
- Oh yeah, needs /usr/ucb/mail (for the Subject line).
-
- #! /bin/sh
- # Usage: newgroup group flag
- # Tell NEWSMASTER to create it themselves using addgroup
-
- # =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
- . ${NEWSCONFIG-/usr/lib/news/bin/config}
- export NEWSCTL NEWSBIN NEWSARTS
- PATH=$NEWSCTL/bin:$NEWSBIN/relay:$NEWSBIN:$NEWSPATH ; export PATH
- umask $NEWSUMASK
-
- hdr=/tmp/nc$$
-
- trap "rm -f $hdr; exit 0" 0
- 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 <<!
- $1
- !
- then # no group in active, but sys file likes it: tell them
- case "$2" in
- moderated) flag=m ;;
- *) flag=y ;;
- esac
- echo "$SENDER says to addgroup $1 $2" | /usr/ucb/mail -s "newgroup $1 $2" $NEWSMASTER
- fi
-