diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-05-19 03:14:36 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-05-19 03:14:36 +0000 |
commit | c2a6ce4622970c4f55d17addee14497a9d34eb28 (patch) | |
tree | e8e556e2a241e98b8fe7a2a8a0eb369554ddb57b /sys-fs/raidtools | |
parent | version bump, add static use flag (diff) | |
download | historical-c2a6ce4622970c4f55d17addee14497a9d34eb28.tar.gz historical-c2a6ce4622970c4f55d17addee14497a9d34eb28.tar.bz2 historical-c2a6ce4622970c4f55d17addee14497a9d34eb28.zip |
dont run if no devices exist
Diffstat (limited to 'sys-fs/raidtools')
-rwxr-xr-x | sys-fs/raidtools/files/raid-start.sh | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/sys-fs/raidtools/files/raid-start.sh b/sys-fs/raidtools/files/raid-start.sh index 2811463dbf2f..a593885e7801 100755 --- a/sys-fs/raidtools/files/raid-start.sh +++ b/sys-fs/raidtools/files/raid-start.sh @@ -1,7 +1,7 @@ # /lib/rcscripts/addons/raid-start.sh: Setup raid volumes at boot # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/raidtools/files/raid-start.sh,v 1.2 2005/03/02 15:20:35 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/raidtools/files/raid-start.sh,v 1.3 2005/05/19 03:14:29 vapier Exp $ [[ -f /proc/mdstat ]] || exit 0 @@ -21,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 |