
#	ATT:#ident	"sadmin:shell/diskumount	2.2"

#ident	"@(#)sadmin/shell:diskumount	25.1"

#	perform a umount, complain if it doesn't work

#!	chmod +x ${file}

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

msg=`/etc/umount ${1:?} 2>&1`
case "${msg}" in
'' )
#	if [ -d "$2" ]
#	then
#		chmod 0 $2
#	fi
	echo '\n' ${2:-$1} "has been unmounted.\n" >&2
	;;
*' 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
