summaryrefslogtreecommitdiff
path: root/scripts/local-top/lvm
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/local-top/lvm')
-rwxr-xr-xscripts/local-top/lvm11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/local-top/lvm b/scripts/local-top/lvm
index fc1036e..5323a7d 100755
--- a/scripts/local-top/lvm
+++ b/scripts/local-top/lvm
@@ -21,7 +21,7 @@ activate_vg()
# Make sure that we have a non-empty argument
if [ -z "${vg}" ]; then
- return 0
+ return 1
fi
# Take care of lilo boot arg, risky activating of all vg
@@ -40,7 +40,12 @@ activate_vg()
# Make sure that we have a d-m path
vg=${vg#/dev/mapper/}
if [ "$vg" = "$1" ]; then
- return 0
+ return 1
+ fi
+
+ # Make sure that the device includes at least one dash
+ if [ "$(echo -n "$vg" | tr -d -)" = "$vg" ]; then
+ return 1
fi
# Split volume group from logical volume.
@@ -61,3 +66,5 @@ modprobe -q dm-mirror
activate_vg "$ROOT"
activate_vg "$resume"
+
+exit 0