From e7fe771246f04782f7299cb5196fb31287c707c6 Mon Sep 17 00:00:00 2001 From: "Bas v.d. Wiel" Date: Mon, 22 May 2023 15:38:13 +0200 Subject: [PATCH] Fix the collapsing of directory names to prevent overlapping dirs from being skipped while mounting. --- nfs_mount.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfs_mount.sh b/nfs_mount.sh index fdd1a2c..7101e36 100755 --- a/nfs_mount.sh +++ b/nfs_mount.sh @@ -241,7 +241,7 @@ function mount_nfs() { fi find "/tmp/${SCRIPT_NAME}" -mindepth 1 -maxdepth 1 -type d | while read -r LDIR; do LDIR="${LDIR##*/}" - if [ -d "/media/fat/${LDIR}" ] && ! mount | grep -q "/media/fat/${LDIR}"; then + if [ -d "/media/fat/${LDIR}" ] && ! mount | grep -qx "/media/fat/${LDIR}"; then if ! mount -o bind "/tmp/${SCRIPT_NAME}/${LDIR}" "/media/fat/${LDIR}"; then /usr/bin/logger "Error: failed to mount directory /tmp/${SCRIPT_NAME}/${LDIR} to /media/fat/${LDIR}" exit 1