Fix conditional test in 02_configure.sh script 88/4388/1
authorGeoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Wed, 4 Aug 2021 14:06:55 +0000 (16:06 +0200)
committerGeoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Wed, 4 Aug 2021 14:06:55 +0000 (16:06 +0200)
Fix a conditional statement that returns an error although the
command ran successfully. Fortunately, this did not affect the
functionality and logic in the script but it generated extra
noise on the console logs that are unnecessary and potentially
confusing to users.

Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Change-Id: Ic59c09e2b2890af37bbb023d0b372baa2f718c2d

env/metal3/02_configure.sh

index 085a162..d2842d2 100755 (executable)
@@ -15,7 +15,8 @@ function check_interface_ip {
     local interface=$1
     local ipaddr=$2
 
-    if [ ! $(ip addr show dev $interface) ]; then
+    ip addr show dev $interface
+    if [ $? -ne 0 ]; then
         exit 1
     fi