File: check

package info (click to toggle)
dracut 005-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,368 kB
  • ctags: 207
  • sloc: sh: 6,487; ansic: 192; makefile: 108
file content (23 lines) | stat: -rwxr-xr-x 480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# if there's no multipath binary, no go.
which multipath >/dev/null 2>&1 || exit 1

[[ $1 = -d ]] && exit 0

. $dracutfunctions
[[ $debug ]] && set -x

is_mpath() {
    [ -e /sys/dev/block/$1/dm/uuid ] || return 1
    [[ $(cat /sys/dev/block/$1/dm/uuid) =~ ^mpath- ]] && return 0
    return 1
}

# Do mpath if we appear to be using it for /
rootdev=$(find_root_block_device)
if [[ $rootdev ]]; then
    check_block_and_slaves is_mpath "$rootdev" && exit 0
fi

exit 1