SetUp revision 7c478bd95313f5f23a4c958a745db2134aa03244
0N/A#!/bin/sh
1111N/A#
0N/A# CDDL HEADER START
0N/A#
0N/A# The contents of this file are subject to the terms of the
0N/A# Common Development and Distribution License, Version 1.0 only
0N/A# (the "License"). You may not use this file except in compliance
0N/A# with the License.
0N/A#
0N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0N/A# or http://www.opensolaris.org/os/licensing.
0N/A# See the License for the specific language governing permissions
0N/A# and limitations under the License.
0N/A#
0N/A# When distributing Covered Code, include this CDDL HEADER in each
0N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A# If applicable, add the following below this CDDL HEADER, with the
0N/A# fields enclosed by brackets "[]" replaced with your own identifying
0N/A# information: Portions Copyright [yyyy] [name of copyright owner]
0N/A#
0N/A# CDDL HEADER END
0N/A#
0N/A#ident "%Z%%M% %I% %E% SMI" /* from SVR4 bnu:SetUp 2.3.1.9 */
0N/A
0N/A# a function to do the dirty work
0N/A# SYNTAX:
0N/A# needit OWNER GROUP MODE name oldname
0N/A
0N/Aneedit() {
0N/Aif [ ! -f $ETC/$4 ]; then
0N/A if [ -f $LIB/$4 ]; then
0N/A cp $LIB/$4 $ETC/$4
0N/A else
0N/A if [ -n "$5" -a -f $LIB/$5 ]; then
0N/A cp $LIB/$5 $ETC/$4
0N/A else
0N/A cp $4 $ETC/$4
0N/A fi
0N/A fi
0N/Afi
0N/Achown $1 $ETC/$4
0N/Achgrp $2 $ETC/$4
0N/Achmod $3 $ETC/$4
0N/Arm -rf $LIB/$4
0N/A$SYMLINK $ETC/$4 $LIB/$4
0N/A}
0N/A
0N/Aexport IFS PATH
0N/AIFS="
0N/A"
0N/APATH="/usr/bin"
0N/A
0N/A# This shell tries to set up all needed uucp database files.
0N/A# Since the names changed from previous versions, it copies those.
0N/A# For the Permissions, it will generate one if none exists
0N/A
0N/ALIB=$ROOT/usr/lib/uucp
0N/AETC=$ROOT/etc/uucp
1111N/A
1111N/AOWNER=uucp
0N/AGROUP=uucp
0N/A
1111N/ADBFILES="Config Devconfig Devices Dialcodes Dialers Grades Limits Permissions Poll Sysfiles Systems"
0N/A
0N/ASYMLINK=${1:-":"};
0N/A
0N/A# For cross environment, just take default files, and exit.
0N/A
0N/Aif [ -n "$CH" ]; then
0N/A PATH="/bin:/usr/bin"
0N/A for i in $DBFILES
0N/A do
0N/A cp $i $ETC
0N/A rm -rf $LIB/$i
0N/A $SYMLINK $ETC/$i $LIB/$i
0N/A done
0N/A exit
0N/Afi
0N/A
0N/A# For real environment, try to preserve user's database files
0N/A
0N/Aneedit $OWNER $GROUP 644 Config
0N/Aneedit $OWNER $GROUP 644 Devconfig
1111N/Aneedit $OWNER $GROUP 644 Devices L-devices
0N/Aneedit $OWNER $GROUP 644 Dialcodes L-dialcodes
0N/Aneedit $OWNER $GROUP 644 Dialers L-dialers
0N/Aneedit $OWNER $GROUP 644 Grades
0N/Aneedit $OWNER $GROUP 644 Limits
0N/Aneedit $OWNER $GROUP 644 Poll
0N/Aneedit $OWNER $GROUP 644 Sysfiles
0N/Aneedit $OWNER $GROUP 600 Systems L.sys
0N/A
0N/A# Permissions is handles differently
0N/Aif [ ! -f $ETC/Permissions ]; then
0N/A if [ -f $LIB/Permissions ]; then
0N/A cp $LIB/Permissions $ETC/Permissions
0N/A else
0N/A if [ -f $ETC/PERMISSIONS ]; then
0N/A cp $ETC/PERMISSIONS $ETC/Permissions
0N/A else
0N/A # Try to generate a Permissions file
0N/A # using uucp entries in /etc/passwd
0N/A > $ETC/Permissions
0N/A set - `sed -n "/uucico/s/:.*//p" /etc/passwd`
0N/A for i
0N/A do
0N/A echo "\tLOGNAME=$i\n"
0N/A done > $ETC/Permissions
0N/A fi
0N/A fi
0N/Afi
0N/Achown $OWNER $ETC/Permissions
0N/Achgrp $GROUP $ETC/Permissions
0N/Achmod 600 $ETC/Permissions
0N/Arm -rf $LIB/Permissions
0N/A$SYMLINK $ETC/Permissions $LIB/Permissions
0N/A
0N/A