#!/sbin/sh
#ident	"@(#)bnu.admin:common/cmd/bnu.admin/validport	1.2.2.4"
#ident "$Header: validport 2.1 91/09/12 $"
################################################################################
#	Module Name: validport.sh
#	
#	Check that the port name is not an empty string
#	and that it corresponds to one of the serial devices
#	configured on the system.
###############################################################################
#trap 'exit 0' 1 2  15

if [ "x" = "x$1" ]
then
	exit 1
fi

for i in `q-add COLLECT ""; cat /usr/tmp/ttylist.$VPID | cut -c6-14`
do
	if [ $i = $1 ]
	then
		exit 0
	fi
done

exit 1

