commit:     6aed9147207be0b96e49d52605397a2fc594ec27
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  4 15:33:48 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Wed Dec  4 15:33:48 2019 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=6aed9147

gen_determineargs.sh: determine_real_args(): Fix /etc/multipath.conf check

Using "-s" is not enough, file could be a directory.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 gen_determineargs.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index 0fd24d5..952b31e 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -900,9 +900,12 @@ determine_real_args() {
                                gen_die "${error_msg}"
                        fi
 
-                       if [ ! -s "/etc/multipath.conf" ]
+                       if [ ! -e "/etc/multipath.conf" ]
                        then
-                               gen_die "'/etc/multipath.conf' is required for 
--multipath but file does not exist or is empty!"
+                               gen_die "'/etc/multipath.conf' is required for 
--multipath but file does not exist!"
+                       elif [[ -d "/etc/multipath.conf" || ! -s 
"/etc/multipath.conf" ]]
+                       then
+                               gen_die "'/etc/multipath.conf' is required for 
--multipath but it is either not a file or is empty!"
                        fi
                fi
 

Reply via email to