diff --git a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 index efc81f1d3..eaa73cd09 100644 --- a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 +++ b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 @@ -172,7 +172,7 @@ function cleanup() local -i max_retry=99 if [ "$NODESETSTATE" != "genimage" ]; then - if mount | grep "/tmp/ofed/mountpoint"; then + if mount | grep -q "/tmp/ofed/mountpoint"; then while ! umount "/tmp/ofed/mountpoint" do (( ++i > max_retry )) && echo "Umount /tmp/ofed/mountpoint failed" >&2 && break @@ -189,7 +189,7 @@ function cleanup() fi # Clean up the ofed iso - if mount | grep "$IMGROOTPATH/tmp/ofed/mountpoint"; then + if mount | grep -q "$IMGROOTPATH/tmp/ofed/mountpoint"; then while ! umount "$IMGROOTPATH/tmp/ofed/mountpoint" do (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/tmp/ofed/mountpoint failed" >&2 && break @@ -201,7 +201,7 @@ function cleanup() fi i=0 - if mount | grep "$IMGROOTPATH/sys"; then + if mount | grep -q "$IMGROOTPATH/sys"; then while ! umount "$IMGROOTPATH/sys" do (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/sys failed" >&2 && break @@ -209,7 +209,7 @@ function cleanup() done fi i=0 - if mount | grep "$IMGROOTPATH/proc"; then + if mount | grep -q "$IMGROOTPATH/proc"; then while ! umount "$IMGROOTPATH/proc" do (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/proc failed" >&2 && break @@ -217,7 +217,7 @@ function cleanup() done fi i=0 - if mount | grep "$IMGROOTPATH/dev"; then + if mount | grep -q "$IMGROOTPATH/dev"; then while ! umount "$IMGROOTPATH/dev" do (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/dev failed" >&2 && break