summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-05-19 03:14:36 +0000
committerMike Frysinger <vapier@gentoo.org>2005-05-19 03:14:36 +0000
commitc2a6ce4622970c4f55d17addee14497a9d34eb28 (patch)
treee8e556e2a241e98b8fe7a2a8a0eb369554ddb57b /sys-fs/mdadm/files
parentversion bump, add static use flag (diff)
downloadhistorical-c2a6ce4622970c4f55d17addee14497a9d34eb28.tar.gz
historical-c2a6ce4622970c4f55d17addee14497a9d34eb28.tar.bz2
historical-c2a6ce4622970c4f55d17addee14497a9d34eb28.zip
dont run if no devices exist
Diffstat (limited to 'sys-fs/mdadm/files')
-rwxr-xr-xsys-fs/mdadm/files/raid-start.sh34
1 files changed, 21 insertions, 13 deletions
diff --git a/sys-fs/mdadm/files/raid-start.sh b/sys-fs/mdadm/files/raid-start.sh
index 1e1985b39a23..c2edc03aa1dd 100755
--- a/sys-fs/mdadm/files/raid-start.sh
+++ b/sys-fs/mdadm/files/raid-start.sh
@@ -1,5 +1,7 @@
# /lib/rcscripts/addons/raid-start.sh: Setup raid volumes at boot
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/files/raid-start.sh,v 1.1 2005/03/02 04:32:07 vapier Exp $
+# 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-start.sh,v 1.2 2005/05/19 03:14:36 vapier Exp $
[[ -f /proc/mdstat ]] || exit 0
@@ -19,22 +21,28 @@ create_devs() {
# Start software raid with raidtools (old school)
if [[ -x /sbin/raidstart && -f /etc/raidtab ]] ; then
- create_devs $(awk '/^[[:space:]]*raiddev/ { print $2 }' /etc/raidtab)
- ebegin "Starting up RAID devices (raidtools)"
- output=$(raidstart -a 2>&1)
- ret=$?
- [[ ${ret} -ne 0 ]] && echo "${output}"
- eend ${ret}
+ devs=$(awk '/^[[:space:]]*raiddev/ { print $2 }' /etc/raidtab)
+ if [[ -n ${devs} ]] ; then
+ create_devs ${devs}
+ ebegin "Starting up RAID devices (raidtools)"
+ output=$(raidstart -a 2>&1)
+ ret=$?
+ [[ ${ret} -ne 0 ]] && echo "${output}"
+ eend ${ret}
+ fi
fi
# Start software raid with mdadm (new school)
if [[ -x /sbin/mdadm && -f /etc/mdadm.conf ]] ; then
- create_devs $(awk '/^[[:space:]]*ARRAY/ { print $2 }' /etc/mdadm.conf)
- ebegin "Starting up RAID devices (mdadm)"
- output=$(mdadm -As 2>&1)
- ret=$?
- [[ ${ret} -ne 0 ]] && echo "${output}"
- eend ${ret}
+ devs=$(awk '/^[[:space:]]*ARRAY/ { print $2 }' /etc/mdadm.conf)
+ if [[ -n ${devs} ]] ; then
+ create_devs ${devs}
+ ebegin "Starting up RAID devices (mdadm)"
+ output=$(mdadm -As 2>&1)
+ ret=$?
+ [[ ${ret} -ne 0 ]] && echo "${output}"
+ eend ${ret}
+ fi
fi
# vim:ts=4