#! /bin/sh
#
# md		Enable or disable multiple devices. If /etc/mdtab doesn't
#		exist or is empty we don't bother; likewise if mdadd or
#		mdstop isn't installed.
#
#		Note that since this is called early in the bootprocess you
#		can't swap to an MD device; but you don't want to do that
#		anyway as the Linux kernel can stripe swap partitions
#		itself (see swapon manpage).
#
# Version:	@(#)md  2.73  08-Jan-1998  miquels@cistron.nl
#

case "$1" in
	start|"")
		if [ -s /etc/mdtab -a -f /sbin/mdadd ]
		then
			[ "$VERBOSE" != no ] && echo "Adding md devices."
			mdadd -ar
		fi
		: ;;
	stop)
		if [ -r /etc/mdtab -a -x /sbin/mdstop ]
		then
			[ "$VERBOSE" != no ] && echo "Stopping md devices."
        		mdstop -a
		fi
		: ;;
	reload)
		echo "Reload not possible, use restart."
		;;
	restart|force-reload)
		/etc/init.d/mdutils stop
		/etc/init.d/mdutils start
		;;
	*)
		echo "Usage: mdutils [start] [stop]" >&2
		false
		;;
esac
