Article View: news.software.b
Article #2419how to *really* get manual newgroup notification in C news
From: Bill Wisner
Date: Sun, 26 Aug 1990 20:37
Date: Sun, 26 Aug 1990 20:37
89 lines
3275 bytes
3275 bytes
OK, so I blew it. My newgroup hackery was committed while under the
influence of sleep deprivation, and I made a couple of stupid little
mistakes. Blah. Here's the right version. (Thanks, tale.)
Bill Wisner <wisner@hayes.fai.alaska.edu> Gryphon Gang Fairbanks AK 99775
"Remember, some net.personalities are basically insane."
-- Karl Lehenbauer <karl@sugar.hackercorp.com>
#! /bin/sh
# newgroup group flag
# subject to our sys file group pattern
#
# Modified by Chip Salzenberg, 7 June 1990.
# Send mail to Usenet administrator describing the newgroup request.
# But if group already exists with correct type, don't bother.
#
# Modified by Bill Wisner, 23 August 1990
# Properly handle changes in moderation status.
#
# Modified by David C Lawrence, 25 August 1990
# Include whole article. Fixed testing for change of status.
#
# Be sure to modify the pathname in line 20 to fit your site's configuration.
# Also, if you're not on a BSD-derived system, you will probably need to
# replace the "Mail" commands on lines 59, 68 and 80.
# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/usr/lib/newsbin/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 "exit 1" 1 2 3 13 15
trap "rm -f $hdr $afile $afilehdr $afilebody; 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; }
# quit if the group already exists in the form requested
pat="^`echo $1 | sed 's/\./\\\\./g'` "
type=`awk "/$pat/ { print \\$4; exit }" $NEWSCTL/active`
case "$type" in
x|=*) exit 0 ;;
y) test "" = "$2" && exit 0 ;;
m) test "moderated" = "$2" && exit 0 ;;
esac
SENDER="`grep '^Sender:' $hdr | sed 's/^[^:]*: *//'`"
case "$SENDER" in
"") SENDER="`grep '^From:' $hdr | sed 's/^[^:]*: *//' `" ;;
esac
if test "$type" = "y" -a "moderated" = "$2"; then
( echo "$SENDER says"
echo "to change the group '$1' from unmoderated to moderated"
echo "in this article:"
echo
cat $afile ) | Mail -s "Make $1 moderated" $NEWSMASTER
exit 0
fi
if test "$type" = "m" -a "moderated" != "$2"; then
( echo "$SENDER says"
echo "to change the group '$1' from moderated to unmoderated"
echo "in this article:"
echo
cat $afile ) | Mail -s "Make $1 unmoderated" $NEWSMASTER
exit 0
fi
( echo "$SENDER says"
if test "moderated" = "$2"; then
echo "to create the moderated group '$1'"
else
echo "to create the group '$1'"
fi
echo "in this article:"
echo
cat $afile ) | Mail -s "Make $1 $2" $NEWSMASTER
exit 0
Technical Details
Message-ID:
<1990Aug26.203720.2157@hayes.fai.alaska.edu>Path:
arc1-ca.pugleaf.net!utzoo!utstat!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!uwm.edu!bionet!hayes.fai.alaska.edu!wisnerShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utstat!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!zaphod.mps.ohio-state.edu!uwm.edu!bionet!hayes.fai.alaska.edu!wisner From: wisner@hayes.fai.alaska.edu (Bill Wisner) Newsgroups: news.software.b Subject: how to *really* get manual newgroup notification in C news Message-ID: <1990Aug26.203720.2157@hayes.fai.alaska.edu> Date: 26 Aug 90 20:37:20 GMT Sender: usenet@hayes.fai.alaska.edu (J Random USENET) Organization: Amnesia International Lines: 89