sys-fs/lvm2: runscript: unify $lvm_path handling
authorThomas Deutschmann <whissi@gentoo.org>
Tue, 14 Apr 2020 17:40:16 +0000 (19:40 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Tue, 14 Apr 2020 18:34:18 +0000 (20:34 +0200)
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
sys-fs/lvm2/files/lvm.rc-2.02.187

index daafffd5b28b81a21a7854dc73cc6e37688a2ca2..1bf8002b9dabecd94e493afe5bc42c7bbfdd5b13 100644 (file)
@@ -71,12 +71,10 @@ start() {
 
        # NOTE: Add needed modules for LVM or RAID, etc
        #       to /etc/modules.autoload if needed
+
        lvm_path="$(_get_lvm_path)"
-       for lvm_path in /bin/lvm /sbin/lvm ; do
-               [ -x "${lvm_path}" ] && break
-       done
-       if [ ! -x "${lvm_path}" ] ; then
-               eerror "Cannot find lvm binary in /sbin or /bin!"
+       if [ -z "${lvm_path}" ] ; then
+               eerror "Failed to find lvm binary in /bin or /sbin!"
                return 1
        fi
        if [ -z "${CDBOOT}" ] ; then
@@ -121,12 +119,9 @@ start_post() {
 }
 
 stop() {
-       for lvm_path in /bin/lvm /sbin/lvm ; do
-               [ -x "${lvm_path}" ] && break
-       done
-
-       if [ ! -x "${lvm_path}" ] ; then
-               eerror "Cannot find lvm binary in /sbin or /bin!"
+       lvm_path="$(_get_lvm_path)"
+       if [ -z "${lvm_path}" ] ; then
+               eerror "Failed to find lvm binary in /bin or /sbin!"
                return 1
        fi