#!/bin/bash

. shell-error
. /.initrd/initenv

PROG="poll: $PROG"

while [ -z "${eof-}" ]; do
	read -r fsdev fsdir _ ||
		eof=1

	[ -n "$fsdev" ] ||
		continue

	if [ -n "${ROOTONLY-}" ]; then
		[ "$fsdir" = "$rootmnt" ] ||
			continue
	fi

	[ -d "$fsdir" ] ||
		fatal "$fsdir: Does not exist"

	mountpoint -q "$fsdir" ||
		fatal "$fsdir: Not mounted"

done < /etc/fstab
