From 0a6f8bdba6c856b36619a120c9f2b7f3aeb2cc4b Mon Sep 17 00:00:00 2001 From: Charles Herlin Date: Thu, 28 Feb 2019 10:14:00 +0100 Subject: [PATCH] FEAT(2.6.x): retrieve actual partition in case if bind mount --- lib/utils.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/utils.sh b/lib/utils.sh index d8b520c..3e7db46 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -318,7 +318,12 @@ is_mounted() { has_mount_option() { local PARTITION=$1 local OPTION=$2 - if $(grep "[[:space:]]$1[[:space:]]" /etc/fstab | grep -vE "^#" | awk {'print $4'} | grep -q "$2"); then + if $(grep "[[:space:]]$PARTITION[[:space:]]" /etc/fstab | grep -vE "^#" | awk {'print $4'} | grep -q "bind"); then + local actual_partition="$(grep "[[:space:]]$PARTITION[[:space:]]" /etc/fstab | grep -vE "^#" | awk {'print $1'})" + debug "$PARTITION is a bind mount of $actual_partition" + PARTITION="$actual_partition" + fi + if $(grep "[[:space:]]$PARTITION[[:space:]]" /etc/fstab | grep -vE "^#" | awk {'print $4'} | grep -q "$OPTION"); then debug "$OPTION has been detected in fstab for partition $PARTITION" FNRET=0 else