[news.admin] adding a new group in non-automatic mode

gilgut@cg-atla.UUCP (10/22/87)

On occassion, new groups show up in my junk directory. No directory for
the group exists, no line in the active file. Sometimes, I even get a
control message saying a new group was created. In any event, if the group
is one that I want to add, I have to edit the active file, and make the
directories. I was surprised that since there is an rmgroup command, I could
not find an add group command. I threw together a quick and dirty shell
script. It could be enhanced, but it wasn't worth my time to parse the
string, substituting dots, slashes, and spaces. It does what's needed, and
that's what counts. Run this as root, as it does call chown, and mkdir.
I also named this "addgrp" as under ULTRIX, there is an addgroup
command in /etc. Feel free to modify and use, but please preserve my
author's line. This is a Bourne Shell utility.
					Steve 
signature file at end contains no executable code....remove
*************************** CUT HERE ****************************** 

DEST=/usr/lib/news
ACT=active
NEWSDIR=/usr/spool/news
AUTHOR="Steven P. Gilgut, Compugraphic Corp; 10/22/87"
CHANGES=" "
echo "NEW NEWSGROUP ADDITION PROGRAM"
echo "Enter the name of this group in the following format"
echo "comp sys dec vax (Use SPACES, not slashes or periods!)"
echo -n "Newsgroup name: "
read ngroup
echo "Enter the name of this group AGAIN in this different format"
echo "comp.sys.dec.vax (Use PERIODS, not slashes or spaces!)"
echo -n "Newsgroup name again: "
read dotngroup
echo -n "Is this newsgroup moderated (y/n) "
read moderated
case $moderated in
	y)
		echo "$dotngroup 00000 00000 m" >> $DEST/$ACT
		;;
	*)
		echo -n "Can this group be posted to from this site? (y/n)"
		read postable
		case $postable in
			y)
				echo "$dotngroup 00000 00000 y" >> $DEST/$ACT
				;;
			*)
				echo "$dotngroup 00000 00000 n" >> $DEST/$ACT
				;;
		esac
		;;
esac
set $ngroup "EOL"
echo $1
cd $NEWSDIR
while (test $1 != "EOL")
do
	test -d $1 ||  mkdir $1 
	chown news $1
	cd $1
	shift
done
cd /
#EOF
*************************** CUT HERE ****************************** 

-- 
Steve Gilgut, Compugraphic Corp. Wilmington, Mass. 01887 (617)658-5600 X5277
I find *almost* nothing as exciting as playing Bach's Tocatta & Fugue in
D Minor, on a large Pipe Organ. 
...!{decvax,ima,ism780c,ulowell,cgeuro,cg-f}!cg-atla!gilgut

page@ulowell.cs.ulowell.edu (Bob Page) (10/23/87)

Why not use 'inews -C net.groupname'?  Works for me, and I don't have
to be root or news to do it.

Better living through RTFM,
-- 
Bob Page, U of Lowell CS Dept.   page@ulowell.{uucp,edu,csnet} 

rick@seismo.CSS.GOV (Rick Adams) (10/23/87)

If you are running news 2.11, to create a group locally, all you
have to do is:
	date | /usr/lib/news/inews -C newgroupname

All of the necessary files will be updated for you

lwv@n8emr.UUCP (Larry W. Virden) (10/25/87)

What version of news allows you to do a inews -C without being a priviledged
users?  We run 2.10.3 at work under a Vax/Ultrix 1.2 setup and it certainly
DOES require me to be a priviledged user - perhaps that is a system configured
setup?  A flag that can be set to allow it?

-- 
Larry W. Virden	 75046,606 (CIS)
674 Falls Place, Reynoldsburg, OH 43068 (614) 864-8817
cbosgd!n8emr!lwv HAM/SWL BBS (HBBS) 614-457-4227.. 300/1200 bps
We haven't inherited the world from our parents, but borrowed it from our children.