FEAT(2.6.x): retrieve actual partition in case if bind mount

This commit is contained in:
Charles Herlin 2019-02-28 10:14:00 +01:00
parent d05ffaf9d5
commit 0a6f8bdba6

View File

@ -318,7 +318,12 @@ is_mounted() {
has_mount_option() { has_mount_option() {
local PARTITION=$1 local PARTITION=$1
local OPTION=$2 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" debug "$OPTION has been detected in fstab for partition $PARTITION"
FNRET=0 FNRET=0
else else