File:  [CSRG BSD Unix] / 43BSD / contrib / news / src / install.sh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:54 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43
BSD 4.3

: '@(#)install.sh	1.12	3/19/86'

if test "$#" != 6
then
	echo "usage: $0 spooldir libdir bindir nuser ngroup ostype"
	exit 1
fi
SPOOLDIR=$1
LIBDIR=$2
BINDIR=$3
NEWSUSR=$4
NEWSGRP=$5
OSTYPE=$6

: Get name of local system
case $OSTYPE in
	usg)	SYSNAME=`uname -n`
		if test ! -d $LIBDIR/history.d
		then
			mkdir $LIBDIR/history.d
			chown $NEWSUSR $LIBDIR/history.d
			chgrp $NEWSGRP $LIBDIR/history.d
		fi;;
	v7)	SYSNAME=`uuname -l`
		touch $LIBDIR/history.pag $LIBDIR/history.dir;;
	*)	echo "$0: Unknown Ostype"
		exit 1;;
esac

if test "$SYSNAME" = ""
then
	echo "$0: Cannot get system name"
	exit 1
fi

: Ensure SPOOLDIR exists
if test ! -d $SPOOLDIR
then
	mkdir $SPOOLDIR
fi
chmod 777 $SPOOLDIR
chown $NEWSUSR $SPOOLDIR
chgrp $NEWSGRP $SPOOLDIR

chown $NEWSUSR $LIBDIR
chgrp $NEWSGRP $LIBDIR

: Ensure certain files in LIBDIR exist
touch $LIBDIR/history $LIBDIR/active $LIBDIR/log $LIBDIR/errlog $LIBDIR/users
chmod 666 $LIBDIR/users

: If no sys file, make one.
if test ! -f $LIBDIR/sys
then
echo
echo Making a $LIBDIR/sys file to link you to oopsvax.
echo You must change oopsvax to your news feed.
echo If you are not in the USA, remove '"usa"' from your line in the sys file.
echo If you are not in North America, remove '"na"' from your line in the sys file.
	cat > $LIBDIR/sys << EOF
$SYSNAME:net,mod,na,usa,to::
oopsvax:net,mod,na,usa,to.oopsvax::
EOF
fi

: If no seq file, make one.
if test ! -s $LIBDIR/seq
then
	echo '100' >$LIBDIR/seq
fi

: if no moderators file, make one.
if test ! -f $LIBDIR/moderators
then
	cat > $LIBDIR/moderators << EOF
mod.ai				[email protected]
mod.compilers			[email protected]
mod.computers.apollo		[email protected]
mod.computers.ibm-pc		[email protected]
mod.computers.laser-printers	[email protected]
mod.computers.pyramid		[email protected]
mod.computers.ridge		[email protected]
mod.computers.sequent		[email protected]
mod.computers.sun		[email protected]
mod.computers.vax		[email protected]
mod.computers.workstations	[email protected]
mod.graphics			[email protected]
mod.human-nets			[email protected]
mod.legal			[email protected]
mod.map				[email protected]
mod.mac				[email protected]
mod.mac.binaries		[email protected]
mod.mac.sources			[email protected]
mod.motss			[email protected]
mod.music			[email protected]
mod.newprod			[email protected]
mod.newslists			[email protected],[email protected]
mod.os				[email protected]
mod.os.os9			[email protected]
mod.os.unix			[email protected]
mod.politics			[email protected]
mod.politics			[email protected]
mod.politics.arms-d		[email protected]
mod.protocols			[email protected]
mod.protocols.appletalk		[email protected]
mod.protocols.kermit		[email protected]
mod.protocols.tcp-ip		[email protected]
mod.rec.guns			[email protected]
mod.recipes			[email protected]
mod.risks			[email protected]
mod.sources			[email protected]
mod.sources.doc			[email protected]
mod.std				[email protected]
mod.std.c			[email protected]
mod.std.mumps			[email protected]
mod.std.unix			[email protected]
mod.techreports			[email protected]
mod.telecom			[email protected]
mod.vlsi			[email protected]
net.announce			[email protected]
net.announce.arpa-internet	[email protected]
net.announce.newusers		[email protected]
EOF
echo
echo Make sure the uucp paths in $LIBDIR/moderators are correct for your site.
fi

sh makeactive.sh $LIBDIR $SPOOLDIR $NEWSUSR $NEWSGRP

for i in $LIBDIR/ngfile $BINDIR/inews $LIBDIR/localgroups
do
	if test -f $i
	then
		echo "$i is no longer used. You should remove it."
	fi
done

for i in $LIBDIR/csendbatch $LIBDIR/c7sendbatch
do
	if test -f $i
	then
		echo "$i is no longer used. You should remove it after"
		echo "changing your crontab entry to use sendbatch [flags]"
	fi
done

if test -f $BINDIR/cunbatch
then
	echo "$BINDIR/cunbatch is not used by the new batching scheme."
	echo "You should remove it when all of your neighbors have upgraded."
fi

: if no aliases file, make one
if test ! -f $LIBDIR/aliases
then
	cat >$LIBDIR/aliases <<EOF
net.chess	net.games.chess
net.forsale	na.forsale
net.joke	net.jokes
net.music.gdea	net.music.gdead
net.notes	net.news.notes
net.periph	net.periphs
net.puzzles	net.puzzle
net.sources.wanted	net.wanted.sources
net.stat	net.math.stat
net.term	net.info-terms
net.trivia	net.games.trivia
net.unix.wizards	net.unix-wizards
net.vlsi	net.lsi
net.works.apollo	net.works
EOF
fi

: if no distributions file, make one
if test ! -f $LIBDIR/distributions
then
	cat >$LIBDIR/distributions <<EOF
local		Local to this site
regional	Everywhere in this general area
usa		Everywhere in the USA
na		Everywhere in North America
world		Everywhere on Usenet in the world (same as net)
EOF
echo
echo You may want to add distributions to $LIBDIR/distributions if your
echo site particpates in a regional distribution such as '"ba"' or '"dc"'.
fi

chown $NEWSUSR $LIBDIR/[a-z]*
chgrp $NEWSGRP $LIBDIR/[a-z]*

echo
echo Reminder: uux must permit rnews if running over uucp.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.