From: hiro@jaist-east.ac.jp (Masahiro Morita)
Subject: Ignoring ctl mess for C News.
Organization: Japan Advanced Institute of Science and Technology Hokuriku,
	Ishikawa, Japan
Distribution: fj
Date: Wed, 29 Jul 1992 02:33:33 GMT


$@?9ED!wKLN&@hC<Bg$H$$$$$^$9!#(J

$@$3$30lO"$N(J mohta $@;a$K$h$k(J $@LBOG$J(J control message $@$K(J $@BP93$9$Y$/!"(J
unmodarate $@$N(J control message $@$r(J $@=hM}$7$J$$$h$&$K$9$k%Q%C%A$r:n$j$^$7$?(J$@!#(J
$@$d$d;~4|$r0o$7$?46$,$"$j$^$9$,!":#$N$&$A$KBP1~$7$F$*$1$P!"$^$?!"$"$N2<$i(J
$@$J$$%a%C%;!<%8$,N.$l$F$b0B(J$@?4$G$9!#(J

$@JQ99$9$k%U%!%$%k$O(J /usr/lib/newsbin/relay/chamod $@$@$1$G$9!#(J
$@$^$?!"<jF0$G(J moderate <=> unmoderate $@$rJQ99$9$k%D!<%k$bMQ0U$7$^$7$?$N$G!"(J
$@%Q%C%A$N8e$K$D$1$F$*$-$^$9!#(J

$@$3$NJQ99$r9T$J$&$H!"(Jrmgroup $@$N$H$-$H$*$J$8$h$&$K!"4IM}<T08$K%a%C%;!<%8$,(J
$@FO$$$?;]%a!<%k$,Aw$i$l$^$9$,!"<B:]$N=hM}$O9T$J$o$l$^$;$s(J$@!#(J
moderate <=> unmoderate $@$NJQ99$r9T$J$&$?$a$K$O!"(J
 # su news -c '/usr/lib/newsbin/maint/changemode <newsgroup> {y|m}'
$@$H$7$^$9!#(J{y|m} $@$N$H$3$m$K$O(J unmoderate $@$K$9$k$H$-$O(J y$@!"(Jmoderate $@$K$9$k(J
$@$H$-$O(J m $@$r(J$@;XDj$7$^$9!#(J<newsgroup> $@$N$H$3$m$OEvA3JQ99$7$?$$%K%e!<%9%0%k!<(J
$@%WL>$r;XDj$7$^$9!#(J

$@$G$O!#(J

--------------- /usr/lib/newsbin/relay/chamod.diff -------------------
*** chamod.bak	Wed Jul 29 11:18:12 1992
--- chamod	Wed Jul 29 11:18:06 1992
***************
*** 19,37 ****
  esac
  
- # watch closely - shell quoting is tricky in the next two awk invocations
- aflag=`awk '$1 == "'$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
- 	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="" ;;
--- 19,22 ----
***************
*** 38,42 ****
  	*)	pfx=un ;;
  	esac
! 	echo "newsgroup $1 was changed to ${pfx}moderated by $SENDER" |
  		mail $NEWSMASTER
- fi
--- 23,26 ----
  	*)	pfx=un ;;
  	esac
! 	echo "$SENDER says to change newsgroup $1 to ${pfx}moderated" |
  		mail $NEWSMASTER
----------------------------------------------------------

--------- /usr/lib/newsbin/maint/chandemode --------------
#!/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

lock="$NEWSCTL/LOCK"
ltemp="$NEWSCTL/L.$$"
echo $$ >$ltemp
trap "rm -f $ltemp ; exit 0" 0 1 2 15
while true
do
        if newslock $ltemp $lock
        then
                trap "rm -f $ltemp $lock ; exit 0" 0 1 2 15
                break
        fi
        echo 'news system locked, waiting...'
        sleep 5
done

# watch closely - shell quoting is tricky in the next two awk invocations
aflag=`awk '$1 == "'$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
	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 locally." |
		mail $NEWSMASTER
fi
------------------------------------------------------
--
                                               | $@KLN&@hC<2J3X5;=QBg3X1!Bg3X(J |
        by $@$R$m$T!<(J                            |    $@%=%U%H%&%'%"4pAC9V:B(J    |
                                               |          $@?9ED>;9((J          |
                                               |    hiro@jaist-east.ac.jp   |