Permalink
Browse files

fix for invalid UUID parsing

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@34056 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information...
1 parent a8dc329 commit 75ed06830caae418df078274ee273b52f43186f7 lcapriotti committed Sep 22, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 diskmounter
View
@@ -48,7 +48,7 @@ for drive in $drivesntfs; do
if [[ ! `grep $drive /etc/fstab` && ! `pmount | grep $drive` && ! `mount | grep $drive` ]]; then
if [ -e /sys/block/${drive%?}/removable ]; then
if [ "$(cat /sys/block/${drive%?}/removable)" = "0" ]; then
- uuid=`blkid /dev/$drive | awk 'BEGIN{RS="UUID="}/-/{gsub(/ .*/,"");print}' | sed s/'"'/''/g`
+ uuid=`blkid -o udev /dev/$drive | grep UUID= | cut -d"=" -f2`
if [ ! -d /media/$uuid ] ; then
mkdir /media/$uuid
fi
@@ -76,7 +76,7 @@ for drive in $drivesfat; do
uuid=`blkid /dev/$drive | awk 'BEGIN{RS="UUID="}/-/{gsub(/ .*/,"");print}' | sed s/'"'/''/g`
if [ -e /sys/block/${drive%?}/removable ]; then
if [ "$(cat /sys/block/${drive%?}/removable)" = "0" ]; then
- uuid=`blkid /dev/$drive | awk 'BEGIN{RS="UUID="}/-/{gsub(/ .*/,"");print}' | sed s/'"'/''/g`
+ uuid=`blkid -o udev /dev/$drive | grep UUID= | cut -d"=" -f2`
if [ ! -d /media/$uuid ] ; then
mkdir /media/$uuid
fi
@@ -104,7 +104,7 @@ for drive in $driveshfs; do
if [[ ! `grep $drive /etc/fstab` && ! `pmount | grep $drive` && ! `mount | grep $drive` ]]; then
if [ -e /sys/block/${drive%?}/removable ]; then
if [ "$(cat /sys/block/${drive%?}/removable)" = "0" ]; then
- uuid=`blkid /dev/$drive | awk 'BEGIN{RS="UUID="}/-/{gsub(/ .*/,"");print}' | sed s/'"'/''/g`
+ uuid=`blkid -o udev /dev/$drive | grep UUID= | cut -d"=" -f2`
if [ ! -d /media/$uuid ] ; then
mkdir /media/$uuid
fi
@@ -131,7 +131,7 @@ for drive in $drivesext; do
if [[ ! `grep $drive /etc/fstab` && ! `pmount | grep $drive` && ! `mount | grep $drive` ]]; then
if [ -e /sys/block/${drive%?}/removable ]; then
if [ "$(cat /sys/block/${drive%?}/removable)" = "0" ]; then
- uuid=`blkid /dev/$drive | awk 'BEGIN{RS="UUID="}/-/{gsub(/ .*/,"");print}' | sed s/'"'/''/g`
+ uuid=`blkid -o udev /dev/$drive | grep UUID= | cut -d"=" -f2`
if [ ! -d /media/$uuid ] ; then
mkdir /media/$uuid
fi

0 comments on commit 75ed068

Please sign in to comment.