Fix an assumption: "btrfs-tools" might not be installed.
And then the "80-btrfs-lvm.rules" doesn't exist, too. Change-Id: Ic9b9217126a303e67c02eaefd1c29126ba87ad54
This commit is contained in:
parent
2835d2e5e7
commit
9fc59ec9be
|
@ -116,12 +116,13 @@ function _drbd_make_vg {
|
|||
}
|
||||
|
||||
function _modify_udev_file {
|
||||
file="$1"
|
||||
search="$2"
|
||||
sed_cmd="$3"
|
||||
local file="$1"
|
||||
local search="$2"
|
||||
local sed_cmd="$3"
|
||||
local path="/lib/udev/rules.d/${file}"
|
||||
|
||||
if ! grep "${search}" "/lib/udev/rules.d/${file}" ; then
|
||||
sudo sed -i "${sed_cmd}" "/lib/udev/rules.d/${file}"
|
||||
if [[ -f "$path" ]] && ! grep "${search}" "$path"; then
|
||||
sudo sed -i "${sed_cmd}" "$path"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue