Merge pull request #46 from basvandewiel/45-folders-with-same-prefix-name-arent-mounted

Fix the collapsing of directory names to prevent overlapping dirs fro…
This commit is contained in:
Bas v.d. Wiel 2023-05-22 15:39:03 +02:00 committed by GitHub
commit dc08d1dd3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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