#!/bin/sh
# Copyright 2011 Paul Parsons
# Distributed under the terms of the GNU General Public License v3 or later

depend="virtfs"
service --depend ${depend} || exit 1

case $1 in
"start")
	fsck -p -A || exit 1
	mount -n -o remount,rw /
	rm -f /etc/mtab /etc/mtab~
	cp /proc/mounts /etc/mtab
	mount -a -t noproc,sysfs,tmpfs,devpts
	;;
"stop")
	umount -a -t noproc,sysfs,tmpfs,devpts
	mount -n -o remount,ro /
	;;
esac

exit 0
