head	1.2;
access;
symbols
	C_3:1.2
	C_2:1.2
	C_1:1.1;
locks; strict;
comment	@# @;


1.2
date	90.08.23.22.29.56;	author roger;	state C_3;
branches;
next	1.1;

1.1
date	90.08.23.19.19.03;	author roger;	state C_1;
branches;
next	;


desc
@@


1.2
log
@porting code drop
@
text
@
# $Id$

#!/bin/sh

# This shell tries to set up all needed uucp system files.
# Since the names changed from previous versions, it copies those.
# For the Permissions, it will generate one if none exists

LIB=$ROOT/usr/lib/uucp
PERM=$LIB/Permissions
LPERM=$LIB/PERMISSIONS
DEVICES=$LIB/Devices
DIAL=$LIB/Dialcodes
DIALERS=$LIB/Dialers
SYSTEM=$LIB/Systems
LSYS=$LIB/L.sys
LDIAL=$LIB/L-dialcodes
LDEVICES=$LIB/L-devices
LDIALERS=$LIB/L-dialers
POLL=$LIB/Poll
UUCP=uucp

if [ "$ROOT" != / -a "$ROOT" != "" ]
then
	# building into an alternate root - always copy the files
	COPY=yes
fi

if [ "$COPY" -o ! -f $SYSTEM ]
then
	if [ -f $LSYS ]; then
		cp $LSYS $SYSTEM
	else
		cp Systems ${SYSTEM}
	fi
	chown $UUCP $SYSTEM
	chmod 400 $SYSTEM
fi

if [ "$COPY" -o ! -f $DIAL ]; then
	if [ -f $LDIAL ]; then
		cp $LDIAL $DIAL
	else
		cp Dialcodes ${DIAL}
	fi
	chown $UUCP $DIAL
	chmod 444 $DIAL
fi

if [ "$COPY" -o ! -f $DIALERS ]; then
	if [ -f $LDIALERS ]; then
		cp $LDIALERS $DIALERS
	else
		cp Dialers $DIALERS

	fi
	chown $UUCP $DIALERS
	chmod 444 $DIALERS
fi

if [ "$COPY" -o ! -f $DEVICES ]; then
	if [ -f $LDEVICES ]; then
		cp $LDEVICES $DEVICES
	else
		cp Devices ${DEVICES}
	fi
	chown $UUCP $DEVICES
	chmod 444 $DEVICES
fi

if [ "$COPY" -o ! -f $POLL ]; then
	cp Poll ${POLL}
	chown $UUCP $POLL
	chmod 644 $POLL
fi

if [ "$COPY" -o ! -f $PERM ]; then
	if [ -f $LPERM ]; then
		cp $LPERM $PERM
		chown $UUCP $PERM
		chmod 400 $PERM
	fi
fi

if [ "$COPY" -o -f $PERM ]; then
	exit
fi

# Try to generate a Permissions file using uucp entries in /etc/passwd

cat <<-! > $PERM
# These entries provide the default permissions.
# See the UUCP Administrators Manual for more information.
!
set - `sed -n "/uucico/s/:.*//p" /etc/passwd`

for i
do
	echo "LOGNAME=$i"
	#echo "\tLOGNAME=$i\n"
done >> $PERM

chown $UUCP $PERM
chmod 400 $PERM
@


1.1
log
@Initial revision
@
text
@d2 1
a2 2
#	Convergent Technologies - System V - Feb 1986
#ident	"@@(#)SetUp	6.2 :/source/cmd/uucp/s.SetUp 6/17/86 10:14:40"
@
