op_bluetooth: Fixed state-restoring on startup
authorMichael Mrozek <EvilDragon@openpandora.de>
Tue, 29 Jun 2010 01:54:44 +0000 (03:54 +0200)
committerMichael Mrozek <EvilDragon@openpandora.de>
Tue, 29 Jun 2010 01:54:44 +0000 (03:54 +0200)
recipes/pandora-system/pandora-scripts/op_bluetooth.sh

index cf33851..93615ff 100644 (file)
@@ -3,9 +3,10 @@
 # Released under the GPL
 
 INTERFACE="`hciconfig | grep "^hci" | cut -d ':' -f 1`"
 # Released under the GPL
 
 INTERFACE="`hciconfig | grep "^hci" | cut -d ':' -f 1`"
-LOCK="~/.op_btenabled"
+LOCK=".op_btenabled"
+cd "$HOME"
 
 
-if [ $1 = "startup" ]; then
+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." 
 
 else
        [ -f "$LOCK" ] && sudo /usr/sbin/hciconfig "$INTERFACE" up pscan 1>/dev/null && sudo /usr/sbin/bluetoothd || echo "Bluetooth: User has not enabled Bluetooth." 
 
 else