#!/bin/sh
#
# Start any arrays which are described in /etc/mdadm/mdadm.conf and which are
# not running already.
#
# Copyright (c) 2001,2002 Mario Jou/3en <joussen@debian.org>
# Distributable under the terms of the GNU GPL version 2.

MDADM=/sbin/mdadm
CONFIG=/etc/mdadm/mdadm.conf

test -x $MDADM || exit 0

if [ ! -f /proc/mdstat ] && [ -x /sbin/modprobe ] ; then
  modprobe -k md > /dev/null 2>&1  
fi
test -f /proc/mdstat || exit 0

case "$1" in
    start)
        if [ -f $CONFIG ] ; then
            echo "Starting raid devices: "
            $MDADM -A -s
            echo "done."
        fi
        ;;
    stop|restart|reload|force-reload)
        ;;
    *)
        echo "Usage: $0 {start|stop|restart|reload|force-reload}"
        exit 1
        ;;
esac

exit 0
