:
#	@(#) mkdev.sh 25.1 92/09/04 
#
#	Copyright (C) 1986-1992 The Santa Cruz Operation, Inc.
#		All Rights Reserved.
#	The information in this file is provided for the exclusive use of
#	the licensees of The Santa Cruz Operation, Inc.  Such users have the
#	right to use, modify, and incorporate this code into other products
#	for purposes authorized by the license agreement provided they include
#	this notice and the associated copyright notice with any such product.
#	The information in this file is provided "AS IS" without warranty.
#
#	/etc/mkdev - SCO UNIX System V/386 Device Configuration
#
PATH=/bin:/usr/bin:/etc

[ $# = 0 ] && {
	echo "Usage: mkdev [ `cd /usr/lib/mkdev;ls -1pd * | sed '/\/$/d' | tr '\012' ' '`]" >&2
	exit 1
	}
script=$1; ${1+shift}

if [ "$OASH" -a -x "$OASH" ]; then
	OAFORMS=/usr/lib/mkdev/oaforms
	OAMENUS=/usr/lib/mkdev/oamenus
	OAFUNCS=${OAFUNCS:-/usr/lib/oash/oafuncs}
	if [ -d $OAFORMS -a -d $OAMENUS -a -f $OAFUNCS ]; then
		export OAFORMS OAMENUS OAFUNCS
	else
		unset OAFORMS OAMENUS OAFUNCS OASH
	fi
else
	unset OASH
fi

if [ -x /usr/lib/mkdev/$script ] 
then
	/usr/lib/mkdev/$script $*
	if [ -d /usr/lib/mkdev/3rdparty ]
	then
		if `ls /usr/lib/mkdev/3rdparty | grep "^$script\." > /dev/null`
		then
			for i in `ls /usr/lib/mkdev/3rdparty/$script.*`
			do
				[ -x $i ] && $i
			done
		fi
	fi
elif [ -x /usr/lib/mkdev/"$script"init ]
then 
	/usr/lib/mkdev/"$script"init $*
	/usr/lib/mkdev/$script $*
	if [ -d /usr/lib/mkdev/3rdparty ]
	then
		if `ls /usr/lib/mkdev/3rdparty | grep "^$script\." > /dev/null`
		then
			for i in `ls /usr/lib/mkdev/3rdparty/$script.*`
			do
				[ -x $i ] && $i
			done
		fi
	fi
else
	echo "mkdev: /usr/lib/mkdev/$script not found" >&2
	exit 2
fi
