gh-10: support device links in mtab

The device in mtab can be a link, for example /dev/disk/by-label/root
pull/15/head
Javi Fontan 9 years ago
parent 382b3d602d
commit c02f84541a

@ -3,6 +3,7 @@
MOUNT_LINE=$(cat /etc/mtab | grep ' / ' | grep -v '^rootfs')
DEVICE=$(echo "$MOUNT_LINE" | cut -d' ' -f1)
DEVICE=$(readlink -f "$DEVICE")
FSTYPE=$(echo "$MOUNT_LINE" | cut -d' ' -f3)
DISK=$(echo "$DEVICE" | sed 's/.$//')

Loading…
Cancel
Save