:
#
#	System V NFS
#
#	Copyright 1986, 1987, 1988, 1989 Lachman Associates, Incorporated (LAI)
#
#	All Rights Reserved.
#
#	The copyright above and this notice must be preserved in all
#	copies of this source code.  The copyright above does not
#	evidence any actual or intended publication of this source
#	code.
#
#	This is unpublished proprietary trade secret source code of
#	Lachman Associates.  This source code may not be copied,
#	disclosed, distributed, demonstrated or licensed except as
#	expressly authorized by Lachman Associates.
#

#      @(#)nmountall	4.4 System V NFS source

#	Copyright (c) 1984, 1986, 1987, 1988 AT&T
#	  All Rights Reserved

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.

#	Mount file systems according to file system table /etc/fstab.
#	Note: written to depend on as few commands as possible.

#	file-system-table format:
#
#	column 1	block special file name of file system
#	column 2	mount-point directory
#	column 3	"-r" if to be mounted read-only
#			"-d" if distributed (remote) resource
#	column 4	file system type (may be column 3)
#	column 5+	ignored
#	White-space separates columns.
#	Lines beginning with "#" are comments.  Empty lines are ignored.
#	a '-' in any field is a no-op.

fstab=/etc/fstab

cat ${fstab} |
	while  read dev fs fsflags fstype dummy
	do
		case ${dev} in
		\#* | '')	#  Ignore comments, empty lines
			continue
		esac
		case ${dev} in
		'-')		#  Ignore no-action lines
			continue
		esac 
		case ${fsflags} in
		'-r') 		# This is the only valid flag in nmountall
			;;

		'-d' | '-dr' | '-rd') #  remote mounts are done in rmountall
			continue
			;;

		'-')		# Ignore '-'
			fsflags=''
			;;

		*)		# It isn't an option, must be fstype
			fstype=${fsflags}
			fsflags=''
			;;
		esac 

		case ${fstype} in
		NFS*)			# this is the only valid fstype
			;;

		*)
			continue
		esac

		fstype="-f ${fstype}"

		echo /etc/mount ${fsflags} ${fstype} ${dev} ${fs}

		/etc/mount ${fsflags} ${fstype} ${dev} ${fs}
	done

