#! /bin/sh

# $Copyright:	$
# Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
# Sequent Computer Systems, Inc.   All rights reserved.
#  
# This software is furnished under a license and may be used
# only in accordance with the terms of that license and with the
# inclusion of the above copyright notice.   This software may not
# be provided or otherwise made available to, or used by, any
# other person.  No title to or ownership of the software is
# hereby transferred.

#ident	"$Header: diskumount 1.4 89/10/11 $@(#)sadmin:shell/diskumount	2.3"
#	perform a umount, complain if it doesn't work

#!	chmod +x ${file}

#	$1 == the device mounted.
#	$2 == the mount point directory (optional).

ndrive='drive'

case "$1" in
-n )
	ndrive=$2
	shift
	shift
esac

msg=`/etc/umount ${1:?} 2>&1`
case "${msg}" in
'' )
	echo >&2 $2 ${2:+'unmounted. '}
	;;
*' busy' )
	echo >&2 "
	The file system is \"busy\" which means that either some command
	is using files under ${2:-it} or someone is logged in and currently
	in a directory within the file system."
	exit 1
	;;
*' not mounted' )
	;;
* )
	admerr $0 "/etc/umount got '${msg}'"
	exit 1
esac
exit 0
