Skip to content

Commit

Permalink
Do only look for LABEL in the first column of fstab
Browse files Browse the repository at this point in the history
Do not allow spaces if matching LABEL in order to ignore mount point and
other fstab line content.

fixes Ferk#25
  • Loading branch information
lmoellendorf committed Mar 26, 2024
1 parent c9859b7 commit 0e164e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion media-automount
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fi

# Check /etc/fstab for an entry corresponding to the device
[ "$UUID" ] && fstab=$(grep /etc/fstab -e "^[^#]*${UUID}") || \
[ "$LABEL" ] && fstab=$(grep /etc/fstab -e "^[^#]*${LABEL}") || \
[ "$LABEL" ] && fstab=$(grep /etc/fstab -e "^[^# ]*${LABEL}") || \
fstab=$(grep /etc/fstab -e "^[ \t]*$dev[ \t]")

# Don't manage devices that are already in fstab
Expand Down

0 comments on commit 0e164e3

Please sign in to comment.