Fix the collapsing of directory names to prevent overlapping dirs from being skipped while mounting.

This commit is contained in:
Bas v.d. Wiel 2023-05-22 15:38:13 +02:00
parent d84fd68e83
commit e7fe771246
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