summaryrefslogtreecommitdiffstats
path: root/main/mdadm/mdadm-raid.initd
blob: ea84088886aac8e2e716b8973efe19289aa2e305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/sbin/runscript

# script to start raid devices described in /etc/mdadm.conf.

start() {
	[ -f /proc/mdstat ] || modprobe -k md > /dev/null 2>&1
	ebegin "Starting RAID devices"
	mdadm -A -s -q
	eend $?						
}

stop() {
	# you need to make sure no device is mounted.
	if [ -f /etc/mdadm.conf ] ; then
		ebegin "Stopping RAID devices"
		mdadm --stop -q `awk '/^ARRAY/ { print $2 }' /etc/mdadm.conf`
		eend $?
	fi
}