Permalink
Browse files

Avoid USB drive event handler from getting more than one mount points

  • Loading branch information...
1 parent e5f3583 commit 65fbae59238541cfc33c606beed43d96d7362060 @javihernandez javihernandez committed Mar 23, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 usbDriveListener/bin/handleUserDeviceEvent.sh
@@ -22,7 +22,7 @@ if [ $1 -eq 1 ]; then
sleep 1
done
- mountLocation=`mount | grep $2 | sed -e "s#/[^ ]\+ [^ ]\+ \(.*\) type.*#\1#"`
+ mountLocation=`mount | grep $2 | sed -e "s#/[^ ]\+ [^ ]\+ \(.*\) type.*#\1#" | head -n 1`
token=`cat "$mountLocation/.gpii-user-token.txt"`
echo "User logged in on device $2 with token ${token}." >> "$logFilePath"
echo $2:$token >> "$usersFilePath" # Keep the location and token in a users file.

0 comments on commit 65fbae5

Please sign in to comment.