diff options
author | Peter Jones <pjones@redhat.com> | 2006-08-31 17:27:40 +0000 |
---|---|---|
committer | Peter Jones <pjones@redhat.com> | 2006-08-31 17:27:40 +0000 |
commit | 5be001f1b5ba29ccc3391f6e5e2f0361b631b127 (patch) | |
tree | 9ddd7149d1325cce78fc4020972344c048fa3b39 /rc.d | |
parent | 0a3eebeef27b8c094ab12a2d9ceaefe927da5791 (diff) | |
download | initscripts-5be001f1b5ba29ccc3391f6e5e2f0361b631b127.tar initscripts-5be001f1b5ba29ccc3391f6e5e2f0361b631b127.tar.gz initscripts-5be001f1b5ba29ccc3391f6e5e2f0361b631b127.tar.bz2 initscripts-5be001f1b5ba29ccc3391f6e5e2f0361b631b127.tar.xz initscripts-5be001f1b5ba29ccc3391f6e5e2f0361b631b127.zip |
- make resolve_dm_name ignore core logger block size when comparing rules
- slightly more readable formatting
- make "line" and "newline" the same variable
- kill 2 exec() calls, add 1.
- shell quoting rill ROT YOUR BRANE.
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/init.d/functions | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 0c278f8a..8847f792 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -562,15 +562,21 @@ resolve_dm_name() { ( name="$1" - line=$(/sbin/dmraid -ay -t --ignorelocking | egrep -iv "^[nN]o " | awk -F ':' "{ if (\$1 ~ /^$name$/) { print \$2; }}") - newline=$line + line=$(/sbin/dmraid -ay -t --ignorelocking | \ + egrep -iv "no block devices found|No RAID disks" | \ + awk -F ':' "{ if (\$1 ~ /^$name$/) { print \$2; }}") for x in $line ; do if [[ "$x" =~ "^/dev/" ]] ; then majmin=$(get_numeric_dev dec $x) - newline=$(echo $newline | sed -e "s,$x\( \|$\),$majmin\1,g") + line=$(sed -e "s,$x\( \|$\),$majmin\1,g" <<< "$line") fi done - /sbin/dmsetup table | egrep -iv "no block devices found|No devices found" | sed -n "s/\(^[^:]\+\): $newline\( \+$\|$\)/\1/p" + line=$(sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' \ + -e 's/ core [12] [[:digit:]]\+ / core [12] [[:digit:]]\\+ /' \ + <<< "$line") + /sbin/dmsetup table | \ + sed -n -e "s/.*\(no block devices found\|No devices found\).*//" \ + -e "s/\(^[^:]\+\): $line\( \+$\|$\)/\1/p" ) 2>/dev/null } |