home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff319.lzh
/
CNewsSrc
/
cnews.orig.lzh
/
relay
/
aux
/
chamod
< prev
next >
Wrap
Text File
|
1989-06-27
|
993b
|
43 lines
#!/bin/sh
# chamod ng flag - change the "moderated" flag for ng to flag
# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/usr/lib/news/bin/config}
export NEWSCTL NEWSBIN NEWSARTS
PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
umask $NEWSUMASK
case "$1" in
"")
echo "$0: null newsgroup not permitted" >&2
exit 1
;;
esac
case "$2" in
moderated) flag=m ;;
*) flag=y ;;
esac
aflag=`awk "/$1/"' { print $4 }' $NEWSCTL/active`
if test "$aflag" != "$flag" -a \( "$aflag" = m -o "$aflag" = y \); then
# old & new flags differ & old flag is m or y
# watch closely - shell quoting is tricky here
awk '
$1 == "'$1'" { # this line is for first arg.
print $1, $2, $3, "'$flag'"
next
}
{ print }
' $NEWSCTL/active >$NEWSCTL/active.new
cp $NEWSCTL/active $NEWSCTL/active.old
cp $NEWSCTL/active.new $NEWSCTL/active
rm -f $NEWSCTL/active.new
case "$flag" in
m) pfx="" ;;
*) pfx=un ;;
esac
echo "newsgroup $1 was changed to ${pfx}moderated by $SENDER" |
mail $NEWSMASTER
fi