Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site pegasus.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!pegasus!hansen From: hansen@pegasus.UUCP (Tony L. Hansen) Newsgroups: net.news.adm,net.news.sa,net.news.b Subject: Re: All these newgroup messages !!! Message-ID: <2677@pegasus.UUCP> Date: Mon, 9-Dec-85 12:21:20 EST Article-I.D.: pegasus.2677 Posted: Mon Dec 9 12:21:20 1985 Date-Received: Tue, 10-Dec-85 06:44:21 EST References: <18@waldo.UUCP> Reply-To: hansen@pegasus.UUCP (60545451-Tony L. Hansen;LZ 3B-315;6243) Organization: AT&T-IS Labs, Lincroft, NJ Lines: 68 Keywords: Argh ... (and a solution) Xref: watmath net.news.adm:456 net.news.sa:222 net.news.b:1277 Summary: new news group shell in /bin/sh Since I have but don't use or even want to use csh, I have rewritten the posted "newgroup" Csh script into a /bin/sh shell script. This shell script should be a standard part of 2.10.3 netnews along side of the rmgroup.sh. Tony Hansen ihnp4!pegasus!hansen #!/bin/sh # This is a shar archive. # The rest of this file is a shell script which will extract: # newgroup.sh # Archive created: Mon Dec 9 12:14:14 EST 1985 echo x - newnewsgrp.sh sed 's/^X//' > newgroup.sh << '~FUNKY STUFF~' #! /bin/sh # # A quick shell script to add new newsgroups without inews -C # It even tries to make any of the needed upper-level directories ... # It assumes that the group is to be postable. # newsuser=news newsgrp=news # may be "daemon" at your site libdir=/usr/lib/news # usually ~${newsuser} active=${libdir}/active spooldir=/usr/spool/news mode=755 # Some people have them mode 777 ... name=$0 # Just the name of this script. case $# in 0 ) echo "Usage: $0 group [ group ] ..." 1>&2 exit 1;; esac cp $active ${active}.old # Just in case !!! for group in $* do echo Adding group $group ... # Now to make sure all the directories exist ... dir=$spooldir for part in `echo $group | sed 's;\.; ;g'` do dir=${dir}/${part} if [ ! -d $dir ] then echo Making directory $dir /bin/mkdir $dir chown $newsuser $dir chgrp $newsgrp $dir chmod $mode $dir fi done # And add to the active file ... echo "$group 00000 00000 y" >> $active done echo All done ... exit 0 ~FUNKY STUFF~ ls -l newnewsgrp.sh # The following exit is to ensure that extra garbage # after the end of the shar file will be ignored. exit 0