summaryrefslogtreecommitdiff
blob: 412f80c264f1ea613e2398eda855620fe3be8120 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# /lib/rcscripts/addons/raid-stop.sh:  Stop raid volumes at shutdown
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/files/raid-stop.sh,v 1.1 2005/06/10 01:35:55 vapier Exp $

[[ -f /proc/mdstat ]] || exit 0

# Stop software raid with raidtools (old school)
if [[ -x /sbin/raidstop && -f /etc/raidtab ]] ; then
	ebegin "Shutting down RAID devices (raidtools)"
	output=$(raidstop -a 2>&1)
	ret=$?
	[[ ${ret} -ne 0 ]] && echo "${output}"
	eend ${ret}
fi

# Stop software raid with mdadm (new school)
if [[ -x /sbin/mdadm && -f /etc/mdadm.conf ]] ; then
	ebegin "Shutting down RAID devices (mdadm)"
	output=$(mdadm -Ss 2>&1)
	ret=$?
	[[ ${ret} -ne 0 ]] && echo "${output}"
	eend ${ret}
fi

# vim:ts=4