From 5817c6d64dc9ca6399a70c20b9b5fb74b94a92b0 Mon Sep 17 00:00:00 2001 From: Tomas M Date: Fri, 21 Sep 2012 08:59:37 -0500 Subject: [PATCH] filesystem recognition --- livekitlib | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/livekitlib b/livekitlib index 6f10f53..cc06b1e 100644 --- a/livekitlib +++ b/livekitlib @@ -213,14 +213,15 @@ mounted_device() device_bestfs() { debug_log "device_bestfs" - local PEEK + local FS - PEEK="$(dd if="$1" bs=1k count=1 2>/dev/null | strings)" - if [ "$(echo "$PEEK" | egrep -i "FAT[13][26]")" != "" ]; then - echo "-t vfat" - elif [ "$(echo "$PEEK" | egrep -i 'NTFS')" != "" ]; then - echo "-t ntfs-3g" + FS="$(blkid "$1" | sed -r "s/.*TYPE=//" | tr -d '"' | tr [A-Z] [a-z])" + if [ "$FS" = "msdos" -o "$FS" = "fat" -o "$FS" = "vfat" ]; then + FS="vfat" + elif [ "$FS" = "ntfs" ]; then + FS="ntfs-3g" fi + echo "-t $FS" } # Find LIVEKIT data by mounting all devices