Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pi-usb-automount
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ then
fi

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

# Don't manage devices that are already in fstab
if [ "$fstab" ]
Expand Down