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 | 8d69f29725a00fdeec2292d6c0428b525c964a46 (patch) | |
tree | fb14eca17c7f9259f694b9839743517946d041c7 /sys-fs | |
parent | version bump, add static use flag (diff) | |
download | gentoo-2-8d69f29725a00fdeec2292d6c0428b525c964a46.tar.gz gentoo-2-8d69f29725a00fdeec2292d6c0428b525c964a46.tar.bz2 gentoo-2-8d69f29725a00fdeec2292d6c0428b525c964a46.zip |
dont run if no devices exist
Diffstat (limited to 'sys-fs')
-rwxr-xr-x | sys-fs/mdadm/files/raid-start.sh | 34 | ||||
-rwxr-xr-x | sys-fs/raidtools/files/raid-start.sh | 32 |
2 files changed, 40 insertions, 26 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 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 |