manual newgroup for C news

Scott Hazen Mueller scott at zorch.SF-Bay.ORG
Fri May 25 00:45:03 AEST 1990


In article <90May22.235719edt.19970 at me.utoronto.ca> eastick at me.utoronto.ca (Doug Eastick) writes:
>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.

Since I'm not the first, I thought that I'd pass along my versions of
ctl/newgroup and ctl/rmgroup.  Also hacked to only pass a message, but sends
along any message text from the original control article.

#! /bin/sh
# newgroup group flag - create group (4-field version: B-2.10.3+ compatible)
#	subject to our sys file group pattern

# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/usr/lib/news/bin/config}
export NEWSCTL NEWSBIN NEWSARTS
PATH=$NEWSCTL/bin:$NEWSBIN/relay:$NEWSBIN:$NEWSPATH ; export PATH # include mkpdir
umask $NEWSUMASK

afile=/tmp/ncd
afilehdr=/tmp/ncdhdr
afilebody=/tmp/ncdbody
hdr=/tmp/nc$$

trap "rm -f $hdr $afile*; exit 0" 0
$NEWSBIN/inject/tear $afile
$NEWSBIN/canonhdr <$afilehdr >$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

( echo "Subject: newgroup $1 $2"; echo "$SENDER says:";
cat $afilebody ) | mail $NEWSMASTER


#! /bin/sh
# rmgroup group - snuff group

# =()<. ${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$$

$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 ||
	{ rm -f $hdr $afile*; 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
( echo "Subject: rmgroup $1"; echo "$SENDER says:";
cat $afilebody ) | mail $NEWSMASTER

rm -f $hdr $afilehdr $afilebody


-- 
Scott Hazen Mueller | scott at zorch.SF-Bay.ORG or (ames|pyramid|vsi1)!zorch!scott
10122 Amador Oak Ct.|(408) 253-6767     |Mail fusion-request at zorch.SF-Bay.ORG
Cupertino, CA  95014|Love make, not more|for emailed sci.physics.fusion digests
SF-Bay Public-Access Unix 408-996-7358/61/78/86 login newuser password public



More information about the Alt.sources mailing list