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


1.4
date	93.04.27.21.38.48;	author roger;	state Exp;
branches;
next	1.3;

1.3
date	90.08.28.22.27.50;	author roger;	state C_3;
branches;
next	1.2;

1.2
date	90.08.23.22.30.04;	author roger;	state C_2;
branches;
next	1.1;

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


desc
@@


1.4
log
@Handle PATH differences.
@
text
@#!/bin/sh

# $Id: Uutry,v 1.3 1990/08/28 22:27:50 roger C_3 roger $
#
#	This shell will start a uucico for the system given.
#	Options:
#	  -xN the debugging level for uucico (-x5 default)
#	  -r  force the removal of the status file
#	The output is put in /tmp/Name where Name is the name
#	of the system name.  A tail -f is performed after uucico is started.

# spool in /var or /usr ?
if [ -d /var ] ; then
    SPOOLROOT=/var
else
    SPOOLROOT=/usr
fi

# /etc config ?
if [ -d /etc/uucp ] ; then
	UUCICO=/usr/sbin/uucico
else
	UUCICO=/usr/lib/uucp/uucico
fi
    
STATUS=${SPOOLROOT}/spool/uucp/.Status

if [ -x "./uucico" ]; then
	UUCICO=./uucico
fi

REMOVE=""
X="-x5"
SYS=
GRADE=
while [ $# -gt 0 ]
do
	case $1 in
	-x)  shift; X="-x$1"; shift;;
	-x*) X=$1; shift;;
	-r) REMOVE="y"; shift;;
	-g)  shift; GRADE="-g$1"; shift;;
	-g*) GRADE=$1; shift;;
	-F) F=$1; shift;;
	*) SYS="$1"; shift;;
	esac
done

if [ -z "$SYS" ]
then
	echo "$0:  system name required"
	exit 1
fi

#  check for existence in Systems file
#  only accept match of full name
#  (important because some names may be prefixes of others!)
XX=
XX=`uuname | grep "^${SYS}$" `
if [ -z "$XX" ]
then
	echo "Invalid system name \"$SYS\""
	exit
fi

STMP=/tmp/$SYS
rm -f $STMP
> $STMP
chmod 660 $STMP
#  remove old status file
if [ -n "$REMOVE" ]; then
    rm -f $STATUS/${SYS}
fi

echo "$UUCICO -r1 -s$SYS  $X $GRADE $F >$STMP 2>&1&"
$UUCICO  -r1 -s$SYS  $X $GRADE $F >$STMP 2>&1&

echo "tmp=$STMP"
#	on heavily loaded systems, may take a moment for uucico
#	to create debug file.
if [ ! -f $STMP ]
then
	sleep 5
fi
tail -f $STMP
@


1.3
log
@Added GRADE support
@
text
@a0 3

# $Id: Uutry,v 1.2 90/08/23 22:30:04 roger C_2 Locker: roger $

d3 2
d12 6
a17 1
STATUS=/usr/spool/uucp/.Status
d19 9
a29 2
else
	UUCICO=/usr/lib/uucp/uucico
@


1.2
log
@porting code drop
@
text
@d2 1
a2 1
# $Id$
d24 1
d31 3
d64 2
a65 2
echo "$UUCICO -r1 -s$SYS  $X >$STMP 2>&1&"
$UUCICO  -r1 -s$SYS  $X >$STMP 2>&1&
@


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