op_bluetooth: restore enabled state
authorUrja Rannikko <urjaman@gmail.com>
Sat, 24 Nov 2012 19:54:16 +0000 (21:54 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 24 Nov 2012 19:55:48 +0000 (21:55 +0200)
recipes/pandora-system/pandora-scripts/op_bluetooth.sh

index b63fe76..fa47d05 100644 (file)
@@ -7,8 +7,13 @@ LOCK=".op_btenabled"
 cd "$HOME"
 
 if [ "$1" = "startup" ]; then
 cd "$HOME"
 
 if [ "$1" = "startup" ]; then
-       [ -f "$LOCK" ] && sudo /usr/sbin/hciconfig "$INTERFACE" up pscan 1>/dev/null && sudo /usr/sbin/bluetoothd || echo "Bluetooth: User has not enabled Bluetooth." 
-
+       if [ -f "$LOCK" ]; then
+               sudo /usr/pandora/scripts/op_bluetooth_work.sh 1
+               INTERFACE="`hciconfig | grep "^hci" | cut -d ':' -f 1`"
+               sudo /usr/sbin/hciconfig "$INTERFACE" up pscan 1>/dev/null && sudo /usr/sbin/bluetoothd
+       else
+               echo "Bluetooth: User has not enabled Bluetooth." 
+       fi
 else   
        # Figure out if Bluetooth is running or not
        
 else   
        # Figure out if Bluetooth is running or not