DataMuseum.dk

Presents historical artifacts from the history of:

Regnecentalen RC-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Regnecentalen RC-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T e

⟦290d6a236⟧ TextFile

    Length: 918 (0x396)
    Types: TextFile
    Names: »etc/umountall «

Derivation

└─⟦3d8f416b2⟧ Bits:30004042/core2.imd SW95705I 386/ix Multi-user Release 1.2
    └─⟦this⟧ »etc/umountall « 

TextFile

#	Unmounts all but the root, "/", file system.
#	Note: written to depend on as few commands as possible.

#!	chmod +x ${file}

kill=
if [ $# -ge 1 ]
then
	case "$1" in
	-k )
		if [ ! -x /etc/fuser ]
		then
			echo >&2 "$0:  -k option not available.  No /etc/fuser found."
			exit 1
		fi
		kill=yes
		;;
	* )
		echo >&2 "Usage:  $0 [ -k ]
-k	kill processes with files open in each file system before unmounting."
		exit 1
	esac
fi

/etc/mount  |
	sort -r  |
	while read fs dummy1 dev mode mode2 dummy2
	do
		case "${mode}" in
		'read/write/remote')
			mode=-d		# remote resource
			;;
		'read')
			case "${mode2}" in
			'only/remote')
				mode=-d
				;;
			esac
			;;
		esac

		case "${fs}" in
		/  |  '' )
			continue
			;;
		* )
			if [ "${mode}" = "-d" ]
			then
				/etc/umount -d ${dev}
			else
				if [ ${kill} ]
				then
					/etc/fuser -k ${dev}
					sleep 10
				fi
				/etc/umount ${dev}
			fi
		esac
	done